Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

is-boolean-object

inspect-js149.5mMIT1.2.2TypeScript support: included

Is this value a JS Boolean? This module works cross-realm/iframe, and despite ES6 @@toStringTag.

Boolean, ES6, toStringTag, @@toStringTag, Boolean object, true, false, is-boolean

readme

is-boolean-object Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

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

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

v1.2.2 - 2025-02-04

Fixed

  • [Fix] do not be tricked by fake Booleans #25

Commits

  • [Dev Deps] update @arethetypeswrong/cli, @ljharb/tsconfig, @types/tape, core-js a27608b
  • [Deps] update call-bound b19953f

v1.2.1 - 2024-12-12

Commits

  • [Refactor] use call-bound directly bb5aa26

v1.2.0 - 2024-12-01

Commits

  • [actions] reuse common workflows 380fa25
  • [meta] use npmignore to autogenerate an npmignore file befa203
  • [actions] split out node 10-20, and 20+ ca31663
  • [New] add types 6d58609
  • [Dev Deps] update eslint, @ljharb/eslint-config, core-js, safe-publish-latest, tape 06cc67e
  • [actions] update codecov uploader 0722346
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, tape 100acdf
  • [actions] update rebase action to use reusable workflow 26333ff
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, core-js, tape fde97ee
  • [Dev Deps] update @ljharb/eslint-config, auto-changelog, core-js, npmignore, tape f5ed3c8
  • [Deps] update call-bind, has-tostringtag 61912e2
  • [Tests] replace aud with npm audit c6a0db5
  • [meta] better eccheck command 3a59ec6
  • [Dev Deps] add missing peer dep c0e10db

v1.1.2 - 2021-08-05

Commits

  • [Refactor] use has-tostringtag to behave correctly in the presence of symbol shams 6d319ea
  • [Dev Deps] update auto-changelog, core-js, eslint, tape 4f85bef

v1.1.1 - 2021-05-07

Commits

  • [actions] use node/install instead of node/run; use codecov action 7201c41
  • [Tests] run tests with core-js as well 9590e61
  • [meta] do not publish github action workflow files 341472b
  • [readme] update repo URLs; remove travis badge 9fdbbc6
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, tape 1cd35c9
  • [readme] add actions and codecov badges 03769fe
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape db6598c
  • [Fix] do not use Object.prototype.toString when Symbol.toStringTag is shammed e0b8a9f
  • [readme] remove defunct testling badge 986a621
  • [meta] use prepublishOnly script for npm 7+ 7bb3b29
  • [Deps] update call-bind 3af6a71
  • [meta] do not publish corejs test file d911f03
  • [actions] update workflows 9bb3d90

v1.1.0 - 2020-12-05

Commits

  • [Tests] migrate tests to Github Actions 6cdb652
  • [Tests] run nyc on all tests 9a33076
  • [Tests] add .editorconfig bb401c0
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, tape 5cb2405
  • [Robustness] use call-bind to avoid a dependency on .call 76d87ae
  • [actions] add "Allow Edits" workflow 337206a
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape 11f0481
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape b9602c8
  • [Dev Deps] update auto-changelog, tape; add aud 999e9e2
  • [actions] switch Automatic Rebase workflow to pull_request_target event bbb6728

v1.0.1 - 2019-12-18

Commits

  • [Tests] use shared travis-ci configs a1778b8
  • Update eslint; use my personal shared eslint config. 2c42c50
  • [Tests] remove jscs 3807025
  • [Tests] up to node v8.4, v7.10, v6.11, v5.12, v4.8; improve matrix; newer npm breaks in older node; improve scripts. a02b986
  • [Dev Deps] update eslint, @ljharb/eslint-config, is, jscs, nsp, semver, tape d9030a9
  • Update eslint, nsp a1b6388
  • [Tests] up to node v10.0, v9.11, v8.11, v6.14, v4.9; use nvm install-latest-npm 17a0fd3
  • [Tests] up to node v12.10, v11.15, v10.16, v8.16, v6.17 0b1818f
  • [meta] remove unused Makefile and associated utilities 33dc0ae
  • Update covert, jscs, eslint, semver 7e513c1
  • [Tests] up to node v11.4, v10.14, v8.14, v6.15 992b849
  • [meta] add auto-changelog 63d71b8
  • Update tape, eslint, semver 76aea69
  • Update tape, jscs, eslint, @ljharb/eslint-config a6cbec0
  • [Dev Deps] update eslint, @ljharb/eslint-config, replace, semver, tape; add safe-publish-latest 7cf6bb0
  • [Dev Deps] update eslint, @ljharb/eslint-config, safe-publish-latest 57d713c
  • [actions] add automatic rebasing / merge commit blocking f7a2bdb
  • [meta] create FUNDING.yml 9765e73
  • [Dev Deps] update eslint, @ljharb/eslint-config, is, replace, semver, tape 5c16b56
  • [Dev Deps] update tape, jscs, eslint, @ljharb/eslint-config 5717aad
  • [Dev Deps] update is, jscs, nsp, eslint, @ljharb/eslint-config, semver 80b924d
  • [Dev Deps] update jscs 2e5479e
  • Test up to io.js v2.2 93379a4
  • [Tests] remove nsp; use npm audit; allow to fail for now 36ae30a
  • [Tests] up to io.js v3.3, node v4.1 ef76976
  • [Tests] use npx aud instead of nsp or npm audit with hoops a1182bd
  • [Dev Deps] update eslint, @ljharb/eslint-config, covert, tape 4f79b47
  • [Tests] up to node v10.3 5e96464
  • [Dev Deps] update eslint, nsp, semver, tape e1eb3fa
  • Only apps should have lockfiles. c7f301f
  • [meta] add funding field fad0366
  • [Dev Deps] update eslint, @ljharb/eslint-config 80d39d9
  • [Tests] use eclint instead of editorconfig-tools 980e91b
  • [Dev Deps] Update tape, eslint 9960830
  • Test up to io.js v3.0 a3c3cd0
  • [Dev Deps] update tape 217fbd6
  • [Tests] only audit prod deps 89284ee
  • [Performance] only use toStringTag code path when the value has that property 2863bc5
  • [Dev Deps] update replace 53e72a5
  • [Enhancement] slight optimization for null a90a3c4
  • [Dev Deps] update tape 9377bd5
  • Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG. 3085530
  • Test on io.js v2.4 8af335c
  • Test on io.js v2.3 1eb3424

v1.0.0 - 2015-04-28

Commits