mirror of
https://github.com/musix-org/musix-oss
synced 2024-11-14 03:30:18 +00:00
18 lines
582 B
JavaScript
18 lines
582 B
JavaScript
var has = require('../internals/has');
|
|
var toIndexedObject = require('../internals/to-indexed-object');
|
|
var indexOf = require('../internals/array-includes').indexOf;
|
|
var hiddenKeys = require('../internals/hidden-keys');
|
|
|
|
module.exports = function (object, names) {
|
|
var O = toIndexedObject(object);
|
|
var i = 0;
|
|
var result = [];
|
|
var key;
|
|
for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
|
|
// Don't enum bug & hidden keys
|
|
while (names.length > i) if (has(O, key = names[i++])) {
|
|
~indexOf(result, key) || result.push(key);
|
|
}
|
|
return result;
|
|
};
|