Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
lodash.isplainobject
Advanced tools
The lodash.isplainobject npm package is a module that provides a function to check if a given value is a plain object, that is, an object created by the Object constructor or one with a null prototype.
Check for plain objects
This feature allows you to verify if a value is a plain object. It returns true for objects created by the Object constructor or with a null prototype and false for any other type of value, including arrays, functions, and instances of built-in JavaScript types like Date.
const isPlainObject = require('lodash.isplainobject');
console.log(isPlainObject({})); // true
console.log(isPlainObject(Object.create(null))); // true
console.log(isPlainObject([1, 2, 3])); // false
console.log(isPlainObject(Function)); // false
console.log(isPlainObject(new Date())); // false
is-plain-object is a package that offers similar functionality to lodash.isplainobject. It checks if an object is a plain object, that is, an object created by the Object constructor or one with a null prototype. It is a smaller package focused solely on this functionality, which might be preferable for those looking to minimize their dependency footprint.
isobject is another npm package that provides a function to check if a value is an object. It's more general than lodash.isplainobject as it returns true for any JavaScript object, not just plain objects. This means it will return true for arrays, functions, and other object types, which might not be desirable if you specifically need to check for plain objects.
The modern build of lodash’s _.isPlainObject
exported as a Node.js/io.js module.
Using npm:
$ {sudo -H} npm i -g npm
$ npm i --save lodash.isplainobject
In Node.js/io.js:
var isPlainObject = require('lodash.isplainobject');
See the documentation or package source for more details.
FAQs
The lodash method `_.isPlainObject` exported as a module.
The npm package lodash.isplainobject receives a total of 20,271,851 weekly downloads. As such, lodash.isplainobject popularity was classified as popular.
We found that lodash.isplainobject demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.