Socket
Socket
Sign inDemoInstall

is-arguments

Package Overview
Dependencies
13
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    is-arguments

Is this an arguments object? It's a harder question than you think.


Version published
Maintainers
1
Install size
137 kB
Created

Package description

What is is-arguments?

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.

What are is-arguments's main functionalities?

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();

Other packages similar to is-arguments

Changelog

Source

v1.1.1 - 2021-08-05

Commits

  • [actions] use node/install instead of node/run; use codecov action dd28b30
  • [meta] do not publish github action workflow files 87e489c
  • [readme] fix repo URLs e2c2c6e
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, tape b9ae62b
  • [readme] add github actions/codecov badges 504c0a5
  • [Fix] use has-tostringtag to behave correctly in the presence of symbol shams dc29e52
  • [Dev Deps] update auto-changelog, eslint, tape a966d25
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape 1218944
  • [meta] use prepublishOnly script for npm 7+ 757dbee
  • [Deps] update call-bind b206f05
  • [actions] update workflows b89b2f1

Readme

Source

is-arguments Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Is this an arguments object? It's a harder question than you think.

Example

var isArguments = require('is-arguments');
var assert = require('assert');

assert.equal(isArguments({}), false);
assert.equal(isArguments([]), false);
(function () {
	assert.equal(isArguments(arguments), true);
}())

Caveats

If you have modified an actual arguments object by giving it a Symbol.toStringTag property, then this package will return false.

Tests

Simply clone the repo, npm install, and run npm test

Keywords

FAQs

Last updated on 05 Aug 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc