Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

object.hasown

Package Overview
Dependencies
2
Maintainers
1
Versions
4
Issues
File Explorer

Advanced tools

object.hasown

ES spec-compliant shim for Object.hasOwn

    1.1.2latest

Version published
Maintainers
1
Weekly downloads
7,834,291
decreased by-20.81%

Weekly downloads

Changelog

Source

v1.1.2 - 2022-11-06

Commits

Readme

Source

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

Keywords

FAQs

What is object.hasown?

ES spec-compliant shim for Object.hasOwn

Is object.hasown popular?

The npm package object.hasown receives a total of 6,580,568 weekly downloads. As such, object.hasown popularity was classified as popular.

Is object.hasown well maintained?

We found that object.hasown 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.

Last updated on 07 Nov 2022

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc