Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
is-arguments
Advanced tools
The is-arguments npm package is designed to check if a given value is an arguments object. This can be particularly useful in functions where you need to differentiate between an array and the arguments object, or when trying to ensure compatibility across different JavaScript environments where the typeof operator might not suffice.
Check if a value is an arguments object
This feature allows you to check if a given value is an arguments object. It's particularly useful in scenarios where you need to distinguish between an array and the arguments object passed to a function.
const isArguments = require('is-arguments');
function example() {
console.log(isArguments(arguments)); // true
console.log(isArguments([1, 2, 3])); // false
}
example();
Similar to is-arguments, isarray checks if a given value is an array. While is-arguments focuses on identifying arguments objects, isarray focuses on arrays. Both packages serve to identify specific data structures, making them useful in different but somewhat related scenarios.
Part of the Lodash library, lodash.isarguments provides a similar functionality to is-arguments by checking if a value is an arguments object. The main difference is that lodash.isarguments comes as part of the larger Lodash utility library, which offers a wide range of functions for different types of data manipulation and checking.
Is this an arguments object? It's a harder question than you think.
var isArguments = require('is-arguments');
var assert = require('assert');
assert.equal(isArguments({}), false);
assert.equal(isArguments([]), false);
(function () {
assert.equal(isArguments(arguments), true);
}())
If you have modified an actual arguments
object by giving it a Symbol.toStringTag
property, then this package will return false
.
Simply clone the repo, npm install
, and run npm test
FAQs
Is this an arguments object? It's a harder question than you think.
We found that is-arguments demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.