is-boolean-object (1.2.2)
Published 2026-02-24 13:58:19 +00:00 by atheaadmin
Installation
registry=npm install is-boolean-object@1.2.2"is-boolean-object": "1.2.2"About this package
is-boolean-object 
Is this value a JS Boolean? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
Example
var isBoolean = require('is-boolean-object');
var assert = require('assert');
assert.notOk(isBoolean(undefined));
assert.notOk(isBoolean(null));
assert.notOk(isBoolean('foo'));
assert.notOk(isBoolean(function () {}));
assert.notOk(isBoolean([]));
assert.notOk(isBoolean({}));
assert.notOk(isBoolean(/a/g));
assert.notOk(isBoolean(new RegExp('a', 'g')));
assert.notOk(isBoolean(new Date()));
assert.notOk(isBoolean(42));
assert.notOk(isBoolean(NaN));
assert.notOk(isBoolean(Infinity));
assert.ok(isBoolean(new Boolean(42)));
assert.ok(isBoolean(false));
assert.ok(isBoolean(Object(false)));
assert.ok(isBoolean(true));
assert.ok(isBoolean(Object(true)));
Tests
Simply clone the repo, npm install, and run npm test
Dependencies
Dependencies
| ID | Version |
|---|---|
| call-bound | ^1.0.3 |
| has-tostringtag | ^1.0.2 |
Development Dependencies
| ID | Version |
|---|---|
| @arethetypeswrong/cli | ^0.17.3 |
| @ljharb/eslint-config | ^21.1.1 |
| @ljharb/tsconfig | ^0.2.3 |
| @types/core-js | ^2.5.8 |
| @types/object-inspect | ^1.13.0 |
| @types/tape | ^5.8.1 |
| auto-changelog | ^2.5.0 |
| core-js | ^3.40.0 |
| eclint | ^2.8.1 |
| encoding | ^0.1.13 |
| eslint | =8.8.0 |
| in-publish | ^2.0.1 |
| npmignore | ^0.3.1 |
| nyc | ^10.3.2 |
| object-inspect | ^1.13.4 |
| safe-publish-latest | ^2.0.0 |
| tape | ^5.9.0 |
| typescript | next |
Keywords
Boolean
ES6
toStringTag
@@toStringTag
Boolean object
true
false
is-boolean
