1. hasown
A robust, ES3 compatible, "has own property" predicate.
hasown
Package: hasown
Created by: inspect-js
Last modified: Sun, 10 Mar 2024 17:38:25 GMT
Version: 2.0.2
License: MIT
Downloads: 153,011,756
Repository: https://github.com/inspect-js/hasOwn

Install

npm install hasown
yarn add hasown

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

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin