UNPKG

995 BJavaScriptView Raw
1"use strict";
2
3exports.__esModule = true;
4
5var _defineProperty = require("../core-js/object/define-property");
6
7var _defineProperty2 = _interopRequireDefault(_defineProperty);
8
9var _getOwnPropertyDescriptor = require("../core-js/object/get-own-property-descriptor");
10
11var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor);
12
13var _getOwnPropertyNames = require("../core-js/object/get-own-property-names");
14
15var _getOwnPropertyNames2 = _interopRequireDefault(_getOwnPropertyNames);
16
17function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
19exports.default = function (obj, defaults) {
20 var keys = (0, _getOwnPropertyNames2.default)(defaults);
21
22 for (var i = 0; i < keys.length; i++) {
23 var key = keys[i];
24 var value = (0, _getOwnPropertyDescriptor2.default)(defaults, key);
25
26 if (value && value.configurable && obj[key] === undefined) {
27 (0, _defineProperty2.default)(obj, key, value);
28 }
29 }
30
31 return obj;
32};
\No newline at end of file