get-own-non-enumerable-keys-x

4.1.2 • Public • Published

Travis status Dependency status devDependency status npm version jsDelivr hits bettercodehub score Coverage Status

get-own-non-enumerable-keys-x

Like Reflect.ownKeys but gets only non-enumerable properties.

wn-non-enumerable-keys-x--module.exports">

module.exports(target)Array

This method returns only the non-enumerable own keys of an object. Note: It is not possible the get a list of non-enumerable own keys in older environments and therefore an empty array will be returned.

Kind: Exported function
Returns: Array - The non-enumerable own keys.
Throws:

  • typeError - If target is null or undefined.
Param Type Description
target Object The target.

Example

import getOwnNonEnumerableKeys from 'get-own-non-enumerable-keys-x';
 
const obj = {bar: 1, foo: 2};
Object.defineProperty(obj, '1', {
  value: 'first',
});
 
const symbol = Symbol('first');
Object.defineProperty(obj, symbol, {
  value: 'second',
});
 
getOwnNonEnumerableKeys(obj); // ['1', symbol]

Package Sidebar

Install

npm i get-own-non-enumerable-keys-x

Weekly Downloads

3

Version

4.1.2

License

MIT

Unpacked Size

572 kB

Total Files

11

Last publish

Collaborators

  • xotic750