Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/modules / ___dist / thisless / getOwnPrototypeNames.js
Size: Mime:
"use strict";

const NATIVE_PROPS_NON_ENUMERABLE = Object.freeze(['__defineGetter__', '__defineSetter__', '__proto__', '__lookupGetter__', '__lookupSetter__', 'hasOwnProperty', 'propertyIsEnumerable', 'toLocaleString', 'isPrototypeOf', 'toString', 'constructor', 'prototype', 'valueOf', // in non-strict mode
'arguments', 'caller', 'callee']);
/**
 * @param {string} name
 * @return {boolean}
 */

const nameIsNotNative = name => !NATIVE_PROPS_NON_ENUMERABLE.includes(name);
/**
 * @desc gets own property names, filters out native methods
 * @param {Object} obj
 * @return {Array<string>}
 */


const getOwnPrototypeNames = obj => Object.getOwnPropertyNames(obj).filter(nameIsNotNative);

exports.getOwnPrototypeNames = getOwnPrototypeNames;
exports.nameIsNotNative = nameIsNotNative;
exports.NATIVE_PROPS_NON_ENUMERABLE = NATIVE_PROPS_NON_ENUMERABLE;