Security News
How Threat Actors are Abusing GitHub’s File Upload Feature to Host Malware
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
object.getownpropertydescriptors
Advanced tools
Changelog
v2.1.6 - 2023-04-20
safe-array-concat
a717eb2
@es-shims/api
, @ljharb/eslint-config
, aud
, tape
b08d70f
define-properties
, es-abstract
95c8479
Array.prototype.reduce
isn’t present in ES3 enginesnpmignore
to autogenerate an npmignore filedefine-properties
, es-abstract
eslint
, @ljharb/eslint-config
, @es-shims/api
, aud
, auto-changelog
, functions-have-names
, safe-publish-latest
, tape
mock-property
es-abstract
prepublishOnly
script for npm 7+eslint
, @ljharb/eslint-config
, @es-shims/api
, aud
, tape
node/install
instead of node/run
; use codecov
actioncall-bind
, es-abstract
eslint
, @ljharb/eslint-config
, aud
, functions-have-names
, has-strict-mode
, tape
es-abstract
; use call-bind
where applicableeslint
, @ljharb/eslint-config
, tape
, functions-have-names
; add aud
pull_request_target
eventnyc
on all testsimplementation
test; run es-shim-api
in postlint; use tape
runneres-abstract
(78% bundle size decrease)define-properties
, es-abstract
eslint
, @ljharb/eslint-config
, functions-have-names
, covert
, replace
, semver
, tape
, @es-shims/api
; add safe-publish-latest
funding
fieldfunctions-have-names
npx aud
instead of nsp
or npm audit
with hoopsjscs
undefined
descriptorses-abstract
eslint
, @ljharb/eslint-config
, @es-shims/api
, jscs
, nsp
, tape
, semver
node
v6.3
, v5.12
, v4.4
Object.getOwnPropertyDescriptors
does not fail when Object.prototype
has a poisoned setter (#1, #2)@es-shims/api
to dev depsdefine-properties
, es-abstract
tape
, jscs
, nsp
, eslint
, @ljharb/eslint-config
, semver
node
v5.5
io.js
v2.4
define-properties
, tape
, eslint
, semver
Array#{concat, reduce}
define_properties
eslint
, semver
, nsp
io.js
v2.3
es-abstract
, tape
, eslint
, jscs
, semver
, covert
io.js
v2.0
es-abstract
, editorconfig-tools
, nsp
, eslint
, semver
, replace
Readme
An ES2017 spec-compliant shim for Object.getOwnPropertyDescriptors
that works in ES5.
Invoke its "shim" method to shim Object.getOwnPropertyDescriptors
if it is unavailable, and if Object.getOwnPropertyDescriptor
is available.
This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the spec.
var getDescriptors = require('object.getownpropertydescriptors');
var assert = require('assert');
var obj = { normal: Infinity };
var enumDescriptor = {
enumerable: false,
writable: false,
configurable: true,
value: true
};
var writableDescriptor = {
enumerable: true,
writable: true,
configurable: true,
value: 42
};
var symbol = Symbol();
var symDescriptor = {
enumerable: true,
writable: true,
configurable: false,
value: [symbol]
};
Object.defineProperty(obj, 'enumerable', enumDescriptor);
Object.defineProperty(obj, 'writable', writableDescriptor);
Object.defineProperty(obj, 'symbol', symDescriptor);
var descriptors = getDescriptors(obj);
assert.deepEqual(descriptors, {
normal: {
enumerable: true,
writable: true,
configurable: true,
value: Infinity
},
enumerable: enumDescriptor,
writable: writableDescriptor,
symbol: symDescriptor
});
var getDescriptors = require('object.getownpropertydescriptors');
var assert = require('assert');
/* when Object.getOwnPropertyDescriptors is not present */
delete Object.getOwnPropertyDescriptors;
var shimmedDescriptors = getDescriptors.shim();
assert.equal(shimmedDescriptors, getDescriptors);
assert.deepEqual(shimmedDescriptors(obj), getDescriptors(obj));
var getDescriptors = require('object.getownpropertydescriptors');
var assert = require('assert');
/* when Object.getOwnPropertyDescriptors is present */
var shimmedDescriptors = getDescriptors.shim();
assert.notEqual(shimmedDescriptors, getDescriptors);
assert.deepEqual(shimmedDescriptors(obj), getDescriptors(obj));
Simply clone the repo, npm install
, and run npm test
FAQs
ES2017 spec-compliant shim for `Object.getOwnPropertyDescriptors` that works in ES5.
The npm package object.getownpropertydescriptors receives a total of 8,650,812 weekly downloads. As such, object.getownpropertydescriptors popularity was classified as popular.
We found that object.getownpropertydescriptors demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.