get-own-non-enumerable-property-symbols-x

2.1.2 • Public • Published

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

get-own-non-enumerable-property-symbols-x

Like Object.getOwnPropertySymbols but gets only non-enumerable properties.

module.exports(target)Array

This method returns only the non-enumerable own property symbols of an object.

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

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

Example

import getOwnNonEnumerablePropertySymbols from 'get-own-non-enumerable-property-symbols-x';

const obj = {bar: 1, foo: 2};

const symbol1 = Symbol('first');
Object.defineProperty(obj, symbo1l, {
  enumerable: false,
  value: 'first',
});

const symbol2 = Symbol('second');
Object.defineProperty(obj, symbol2, {
  enumerable: true,
  value: 'second',
});

console.log(getOwnNonEnumerablePropertySymbols(obj)); // [symbol1]

Package Sidebar

Install

npm i get-own-non-enumerable-property-symbols-x

Weekly Downloads

3

Version

2.1.2

License

MIT

Unpacked Size

306 kB

Total Files

11

Last publish

Collaborators

  • xotic750