hasown (2.0.2)

Published 2026-02-24 13:57:40 +00:00 by atheaadmin

Installation

registry=
npm install hasown@2.0.2
"hasown": "2.0.2"

About this package

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

Dependencies

Dependencies

ID Version
function-bind ^1.1.2

Development Dependencies

ID Version
@arethetypeswrong/cli ^0.15.1
@ljharb/eslint-config ^21.1.0
@ljharb/tsconfig ^0.2.0
@types/function-bind ^1.1.10
@types/mock-property ^1.0.2
@types/tape ^5.6.4
aud ^2.0.4
auto-changelog ^2.4.0
eslint =8.8.0
evalmd ^0.0.19
in-publish ^2.0.1
mock-property ^1.0.3
npmignore ^0.3.1
nyc ^10.3.2
safe-publish-latest ^2.0.0
tape ^5.7.5
typescript next

Keywords

has hasOwnProperty hasOwn has-own own has property in javascript ecmascript
Details
npm
2026-02-24 13:57:40 +00:00
1
Jordan Harband
MIT
latest
4.0 KiB
Assets (1)
Versions (1) View all
2.0.2 2026-02-24