1 | 'use strict';
|
2 | var uncurryThis = require('../internals/function-uncurry-this');
|
3 | var hasOwn = require('../internals/has-own-property');
|
4 | var toIndexedObject = require('../internals/to-indexed-object');
|
5 | var indexOf = require('../internals/array-includes').indexOf;
|
6 | var hiddenKeys = require('../internals/hidden-keys');
|
7 |
|
8 | var push = uncurryThis([].push);
|
9 |
|
10 | module.exports = function (object, names) {
|
11 | var O = toIndexedObject(object);
|
12 | var i = 0;
|
13 | var result = [];
|
14 | var key;
|
15 | for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
|
16 |
|
17 | while (names.length > i) if (hasOwn(O, key = names[i++])) {
|
18 | ~indexOf(result, key) || push(result, key);
|
19 | }
|
20 | return result;
|
21 | };
|