WUT_Computer_Science/EGUI/lab3/front/node_modules/object.hasown
2022-06-15 03:02:51 +02:00
..
.github chore 2022-06-15 03:02:51 +02:00
test chore 2022-06-15 03:02:51 +02:00
.eslintrc chore 2022-06-15 03:02:51 +02:00
.nycrc chore 2022-06-15 03:02:51 +02:00
auto.js chore 2022-06-15 03:02:51 +02:00
CHANGELOG.md chore 2022-06-15 03:02:51 +02:00
implementation.js chore 2022-06-15 03:02:51 +02:00
index.js chore 2022-06-15 03:02:51 +02:00
index.mjs chore 2022-06-15 03:02:51 +02:00
LICENSE chore 2022-06-15 03:02:51 +02:00
package.json chore 2022-06-15 03:02:51 +02:00
polyfill.js chore 2022-06-15 03:02:51 +02:00
README.md chore 2022-06-15 03:02:51 +02:00
shim.js chore 2022-06-15 03:02:51 +02:00

object.hasown Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ES spec-compliant Object.hasOwn shim. Invoke its "shim" method to shim Object.hasOwn if it is unavailable or noncompliant.

This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the spec.

Most common usage:

var assert = require('assert');
var hasOwn = require('object.hasown');

var obj = { a: 1, b: 2 };

assert(hasOwn(obj, 'a'));
assert(hasOwn(obj, 'b'));
assert('toString' in obj && !hasOwn(obj, 'toString'));

if (!Object.hasOwn) {
	hasOwn.shim();
}

assert.deepEqual(Object.hasOwn(obj, 'a'), hasOwn(obj, 'a'));

Tests

Simply clone the repo, npm install, and run npm test