1.0.0 • Published 4 years ago
hopx v1.0.0
hopx
hopx
is an update of native hasOwnProperty
to prevent use of Object.prototypes
buitins directly. See ESLint documentation for more information.
The function check if an object has a local property.
Installation
The plugin is available as the hopx
package name on npm and Github.
npm i --save-dev hopx
yarn add --dev hopx
Environment
hopx
was built for Node.js >=8.11.2
.
Usage
Basic usage
The following example check if foo
object has bar
or a
property and return a boolean.
const hopx = require('hopx')
const foo = { bar: 1 }
hopx(obj, 'bar') // true
hopx(obj, 'a') // false
Parameters
first parameter
object
Tells to the function the object to check.
second parameter
any types
Tells to the function the local property to check.
Licence
hopx is licensed under the MIT License.
Created with ♥ by @yoriiis.
1.0.0
4 years ago