Newer
Older
alert / js / node_modules / @babel / runtime / helpers / esm / defaults.js
@Réz István Réz István on 18 Nov 2021 370 bytes first commit
export default function _defaults(obj, defaults) {
  var keys = Object.getOwnPropertyNames(defaults);

  for (var i = 0; i < keys.length; i++) {
    var key = keys[i];
    var value = Object.getOwnPropertyDescriptor(defaults, key);

    if (value && value.configurable && obj[key] === undefined) {
      Object.defineProperty(obj, key, value);
    }
  }

  return obj;
}