Socket
Socket
Sign inDemoInstall

is-arguments

Package Overview
Dependencies
0
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
Weekly downloads
21M
decreased by-7.84%
Maintainers
1
Install size
20.0 kB
Created
Weekly downloads
 

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.0.3 - 2018-11-02

Fixed

  • [Fix] add awareness of Symbol.toStringTag #20

Commits

  • [Tests] up to node v8.1; v7.10, v6.11, v4.8; improve matrix; newer npm fails on older node ea5f23c
  • [Tests] up to node v9.1, v8.9, v6.12; use nvm install-latest-npm; pin included builds to LTS. 697a0a1
  • [Tests] up to node v10.0, v9.11, v8.11, v6.14, v4.9 40045c5
  • [Dev Deps] update eslint, @ljharb/eslint-config, jscs, tape 08abc0d
  • [Tests] up to node v11.1, v10.13, v8.12 bf8d275
  • [Tests] up to node v7.0, v6.9, v4.6; improve test matrix f813d86
  • [Dev Deps] update tape, jscs, eslint, @ljharb/eslint-config e4f9aee
  • [Dev Deps] update jscs, eslint, @ljharb/eslint-config 6c98d11
  • [Dev Deps] update jscs, eslint, @ljharb/eslint-config 8e3178d
  • package.json: use object form of "author", add "contributors" decc4fe
  • [Dev Deps] update jscs, eslint, @ljharb/eslint-config 514902a
  • [Tests] up to node v5.6, v4.3 f11f47c
  • [Dev Deps] add npm run security 4adf82c
  • [Dev Deps] update tape, jscs, eslint, @ljharb/eslint-config f587aeb
  • [Dev Deps] update eslint, @ljharb/eslint-config, nsp, tape 4f587bb
  • [Tests] up to node v6.2, v5.11 36939c5
  • [Dev Deps] update eslint, @ljharb/eslint-config, nsp, tape d779cc8
  • Only apps should have lockfiles f50ce65
  • [Dev Deps] update tape, jscs, eslint, @ljharb/eslint-config 3025559
  • [Dev Deps] update tape, jscs, eslint, @ljharb/eslint-config 3b9ddee
  • [Tests] up to v5.8, v4.4 d4902cf
  • [Tests] fix npm upgrades for older nodes c617dd3
  • [Tests] up to node v5.3 cdd2a61
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape 7719172
  • [Dev Deps] update es5-shim, tape, nsp, eslint 6a5f82b
  • [Dev Deps] update tape, eslint, @ljharb/eslint-config c896c1c
  • [Tests] Use pretest for running the linter. 83db117
  • [Dev Deps] update @ljharb/eslint-config, eslint 57fdc63
  • [Tests] up to node v7.2 aa3eacf
  • [Tests] up to node v5.10 94ff6d7
  • [Tests] on node v4.2 cdb1fb5

Readme

Source

#is-arguments Version Badge

Build Status dependency status dev dependency status License Downloads

npm badge

browser support

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 03 Nov 2018

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