objectWithoutProperties.js 759 B

123456789101112131415161718192021222324
  1. var _Object$getOwnPropertySymbols = require("../core-js/object/get-own-property-symbols");
  2. var objectWithoutPropertiesLoose = require("./objectWithoutPropertiesLoose");
  3. function _objectWithoutProperties(source, excluded) {
  4. if (source == null) return {};
  5. var target = objectWithoutPropertiesLoose(source, excluded);
  6. var key, i;
  7. if (_Object$getOwnPropertySymbols) {
  8. var sourceSymbolKeys = _Object$getOwnPropertySymbols(source);
  9. for (i = 0; i < sourceSymbolKeys.length; i++) {
  10. key = sourceSymbolKeys[i];
  11. if (excluded.indexOf(key) >= 0) continue;
  12. if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
  13. target[key] = source[key];
  14. }
  15. }
  16. return target;
  17. }
  18. module.exports = _objectWithoutProperties;