The published dependency-free is-arguments package as a vendorable file. Useful when you want the classic arguments-object check locally without keeping the npm dependency.
Why copy this?
This page ships the dependency-free is-arguments file in both raw and normalized forms. The value is to keep the classic arguments-object check local and inspectable without another dependency.
Native alternative: There is no direct native helper for the package's exact arguments-object detection contract.
Note: Current is-arguments releases pull in helper packages. This snippet intentionally uses the simpler 1.0.4 release line as a vendorable first pass.
This copy is your responsibility once you adopt it. It does not
automatically receive upstream bug fixes or security updates.
Snippet
Copy-first distribution
Project-specific, rule-based variant for easier Node.js and Bun copy-paste use. Not an official upstream distribution.
Keeps the published package shape as-is.
Normalized
ESM / TS / normalized
Runtime: node, bun
/**
* Derived from is-arguments@1.0.4
* Rule-based normalized variant generated by this repository.
* Preserve the upstream license and attribution notices when copying this file.
*/
/**
* Derived from is-arguments@1.0.4
* Rule-based normalized variant generated by this repository.
* See THIRD_PARTY_NOTICES.md for upstream license and attribution details.
*/
"use strict";
var hasToStringTag = typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol";
var toStr = Object.prototype.toString;
var isStandardArguments = function isArguments(value) {
if (hasToStringTag && value && typeof value === "object" && Symbol.toStringTag in value) {
return false;
}
return toStr.call(value) === "[object Arguments]";
};
var isLegacyArguments = function isArguments(value) {
if (isStandardArguments(value)) {
return true;
}
return (
value !== null &&
typeof value === "object" &&
typeof value.length === "number" &&
value.length >= 0 &&
toStr.call(value) !== "[object Array]" &&
toStr.call(value.callee) === "[object Function]"
);
};
var supportsStandardArguments = (function () {
return isStandardArguments(arguments);
})();
isStandardArguments.isLegacyArguments = isLegacyArguments;
export default supportsStandardArguments ? isStandardArguments : isLegacyArguments;
Variant note: Rule-based normalization for modern TS projects. The goal is easier import and build compatibility, not changed behavior.