defaults.js 788 B

123456789101112131415161718192021222324
  1. var _Object$getOwnPropertyNames = require("@babel/runtime-corejs3/core-js/object/get-own-property-names");
  2. var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js/object/get-own-property-descriptor");
  3. var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
  4. function _defaults(obj, defaults) {
  5. var keys = _Object$getOwnPropertyNames(defaults);
  6. for (var i = 0; i < keys.length; i++) {
  7. var key = keys[i];
  8. var value = _Object$getOwnPropertyDescriptor(defaults, key);
  9. if (value && value.configurable && obj[key] === undefined) {
  10. _Object$defineProperty(obj, key, value);
  11. }
  12. }
  13. return obj;
  14. }
  15. module.exports = _defaults;
  16. module.exports["default"] = module.exports, module.exports.__esModule = true;