ilya_shyian 1c5a2a8f35 +react/react-store 3 년 전
..
.github 1c5a2a8f35 +react/react-store 3 년 전
test 1c5a2a8f35 +react/react-store 3 년 전
.eslintignore 1c5a2a8f35 +react/react-store 3 년 전
.eslintrc 1c5a2a8f35 +react/react-store 3 년 전
.nycrc 1c5a2a8f35 +react/react-store 3 년 전
CHANGELOG.md 1c5a2a8f35 +react/react-store 3 년 전
LICENSE 1c5a2a8f35 +react/react-store 3 년 전
README.md 1c5a2a8f35 +react/react-store 3 년 전
auto.js 1c5a2a8f35 +react/react-store 3 년 전
implementation.js 1c5a2a8f35 +react/react-store 3 년 전
index.js 1c5a2a8f35 +react/react-store 3 년 전
index.mjs 1c5a2a8f35 +react/react-store 3 년 전
package.json 1c5a2a8f35 +react/react-store 3 년 전
polyfill.js 1c5a2a8f35 +react/react-store 3 년 전
shim.js 1c5a2a8f35 +react/react-store 3 년 전

README.md

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