UNPKG

720 BJavaScriptView Raw
1// ag-grid-react v26.2.0
2"use strict";
3Object.defineProperty(exports, "__esModule", { value: true });
4// effectively Object.assign - here for IE compatibility
5exports.assignProperties = function (to, from) {
6 var styleKeys = Object.keys(from);
7 styleKeys.forEach(function (key) {
8 to[key] = from[key];
9 });
10};
11/*
12 * http://stackoverflow.com/a/13719799/2393347
13 */
14exports.assign = function (obj, prop, value) {
15 if (typeof prop === 'string')
16 prop = prop.split('.');
17 if (prop.length > 1) {
18 var e = prop.shift();
19 exports.assign(obj[e] = Object.prototype.toString.call(obj[e]) === '[object Object]' ? obj[e] : {}, prop, value);
20 }
21 else
22 obj[prop[0]] = value;
23};