defaults.js 1.0 KB

123456789101112131415161718192021222324252627
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. Object.defineProperty(exports, "defaults", {
  6. enumerable: true,
  7. get: function() {
  8. return defaults;
  9. }
  10. });
  11. function defaults(target, ...sources) {
  12. for (let source of sources){
  13. for(let k in source){
  14. var _target_hasOwnProperty;
  15. if (!(target === null || target === void 0 ? void 0 : (_target_hasOwnProperty = target.hasOwnProperty) === null || _target_hasOwnProperty === void 0 ? void 0 : _target_hasOwnProperty.call(target, k))) {
  16. target[k] = source[k];
  17. }
  18. }
  19. for (let k of Object.getOwnPropertySymbols(source)){
  20. var _target_hasOwnProperty1;
  21. if (!(target === null || target === void 0 ? void 0 : (_target_hasOwnProperty1 = target.hasOwnProperty) === null || _target_hasOwnProperty1 === void 0 ? void 0 : _target_hasOwnProperty1.call(target, k))) {
  22. target[k] = source[k];
  23. }
  24. }
  25. }
  26. return target;
  27. }