UNPKG

854 BJavaScriptView Raw
1import _Object$getOwnPropertySymbols from "../../core-js/object/get-own-property-symbols";
2import _Object$keys from "../../core-js/object/keys";
3export default function _objectWithoutProperties(source, excluded) {
4 if (source == null) return {};
5 var target = {};
6
7 var sourceKeys = _Object$keys(source);
8
9 var key, i;
10
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
17 if (_Object$getOwnPropertySymbols) {
18 var sourceSymbolKeys = _Object$getOwnPropertySymbols(source);
19
20 for (i = 0; i < sourceSymbolKeys.length; i++) {
21 key = sourceSymbolKeys[i];
22 if (excluded.indexOf(key) >= 0) continue;
23 if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
24 target[key] = source[key];
25 }
26 }
27
28 return target;
29}
\No newline at end of file