New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

help-object

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

help-object

Small js package I use to help me dealing with objects

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

help-object

Small js package I use to help me dealing with objects

XO code style GitHub workflow status npm bundle size npm downloads

Install

$ npm install help-object

Import

This package is pure ESM. It cannot be require()'d from CommonJS.

Use import foo from 'foo' instead of const foo = require('foo') to import the package.

// Load entire build
import * as helpObject from 'help-object';

// Load by method
import {main} from 'help-object';

If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).

You also need to make sure you're on the latest minor version of Node.js. At minimum Node.js 12.20, 14.14, or 16.0.

Read more here: sindresorhus/esm-package

Usage

const object = { 'a': { 'b': 2 } }
const other = create({ 'a': create({ 'b': 2 }) })

helpObject.has(object, 'a')
// => true

helpObject.has(other, 'a')
// => false

forEachEntry : The function will be called with (key, value) as arguments.

functions : Creates an array of function property names from own enumerable properties of object.

has : Checks if key is a direct property of object.

invert : Creates an object composed of the inverted keys and values of object.

invertBy : This method is like invert except that the inverted object is generated from the results of running each element of object thru iteratee.

keysIn : Creates an array of the own and inherited enumerable property names of object.

mapKey : The opposite of mapValue this method creates an object with the same values as object and keys generated by running each own enumerable string keyed property of object thru iteratee.

mapObj : Creates an array of values by running each property of object thru iteratee.

mapValue : Creates an object with the same keys as object and values generated by running each own enumerable string keyed property of object thru iteratee.

toPlainObject : Converts value to a plain object flattening inherited enumerable string keyed properties of value to own properties of the plain object.

License

MIT © Paul Nodet

Keywords

helper

FAQs

Package last updated on 28 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts