hasown
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

hasown Version Badge

github actions coverage License Downloads

npm badge

A robust, ES3 compatible, "has own property" predicate.

Example

const assert = require('assert');
const hasOwn = require('hasown');

assert.equal(hasOwn({}, 'toString'), false);
assert.equal(hasOwn([], 'length'), true);
assert.equal(hasOwn({ a: 42 }, 'a'), true);

Tests

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.2
    23,196,498
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.2
    23,196,498
  • 2.0.1
    3,661,215
  • 2.0.0
    9,631,384
  • 1.0.1
    7,855

Package Sidebar

Install

npm i hasown

Weekly Downloads

36,496,952

Version

2.0.2

License

MIT

Unpacked Size

8.77 kB

Total Files

10

Last publish

Collaborators

  • ljharb
  • radubrehar