![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
is-boolean-object
Advanced tools
Is this value a JS Boolean? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
The is-boolean-object npm package is a utility that allows you to determine if a given value is a boolean object. This can be particularly useful in scenarios where you need to validate or enforce data types in your JavaScript code.
Check if a value is a boolean object
This feature allows you to check if a given value is a boolean object. The code sample demonstrates how to use the is-boolean-object package to differentiate between primitive boolean values and boolean objects.
const isBooleanObject = require('is-boolean-object');
console.log(isBooleanObject(true)); // false
console.log(isBooleanObject(false)); // false
console.log(isBooleanObject(new Boolean(true))); // true
console.log(isBooleanObject(new Boolean(false))); // true
The is-boolean package is a utility that checks if a value is a boolean primitive. Unlike is-boolean-object, it does not check for boolean objects created with the Boolean constructor.
The lodash.isboolean package is part of the Lodash library and checks if a value is a boolean primitive. It is similar to is-boolean but is part of a larger utility library, offering more functionality beyond just type checking.
The is-primitive package checks if a value is a primitive type, including boolean primitives. It does not specifically check for boolean objects, making it broader in scope compared to is-boolean-object.
Is this value a JS Boolean? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
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)));
Simply clone the repo, npm install
, and run npm test
FAQs
Is this value a JS Boolean? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
The npm package is-boolean-object receives a total of 0 weekly downloads. As such, is-boolean-object popularity was classified as not popular.
We found that is-boolean-object demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.