_object_without_properties_loose.js 488 B

1234567891011121314151617
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = _objectWithoutPropertiesLoose;
  6. function _objectWithoutPropertiesLoose(source, excluded) {
  7. if (source == null) return {};
  8. var target = {};
  9. var sourceKeys = Object.keys(source);
  10. var key, i;
  11. for(i = 0; i < sourceKeys.length; i++){
  12. key = sourceKeys[i];
  13. if (excluded.indexOf(key) >= 0) continue;
  14. target[key] = source[key];
  15. }
  16. return target;
  17. }