mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08: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;
|
|
};
|