is-boolean-object
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -8,2 +8,13 @@ # Changelog | ||
## [v1.2.2](https://github.com/inspect-js/is-boolean-object/compare/v1.2.1...v1.2.2) - 2025-02-04 | ||
### Fixed | ||
- [Fix] do not be tricked by fake Booleans [`#25`](https://github.com/inspect-js/is-boolean-object/issues/25) | ||
### Commits | ||
- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape`, `core-js` [`a27608b`](https://github.com/inspect-js/is-boolean-object/commit/a27608b83f154875736bb5e77bf1a70da307b64f) | ||
- [Deps] update `call-bound` [`b19953f`](https://github.com/inspect-js/is-boolean-object/commit/b19953f90f88435a0b0888692f065c959812f710) | ||
## [v1.2.1](https://github.com/inspect-js/is-boolean-object/compare/v1.2.0...v1.2.1) - 2024-12-12 | ||
@@ -10,0 +21,0 @@ |
@@ -27,3 +27,3 @@ 'use strict'; | ||
} | ||
return hasToStringTag && Symbol.toStringTag in value ? tryBooleanObject(value) : $toString(value) === boolClass; | ||
return hasToStringTag ? tryBooleanObject(value) : $toString(value) === boolClass; | ||
}; |
{ | ||
"name": "is-boolean-object", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"author": "Jordan Harband <ljharb@gmail.com>", | ||
@@ -42,13 +42,14 @@ "funding": { | ||
"dependencies": { | ||
"call-bound": "^1.0.2", | ||
"call-bound": "^1.0.3", | ||
"has-tostringtag": "^1.0.2" | ||
}, | ||
"devDependencies": { | ||
"@arethetypeswrong/cli": "^0.17.0", | ||
"@arethetypeswrong/cli": "^0.17.3", | ||
"@ljharb/eslint-config": "^21.1.1", | ||
"@ljharb/tsconfig": "^0.2.0", | ||
"@ljharb/tsconfig": "^0.2.3", | ||
"@types/core-js": "^2.5.8", | ||
"@types/tape": "^5.6.5", | ||
"@types/object-inspect": "^1.13.0", | ||
"@types/tape": "^5.8.1", | ||
"auto-changelog": "^2.5.0", | ||
"core-js": "^3.39.0", | ||
"core-js": "^3.40.0", | ||
"eclint": "^2.8.1", | ||
@@ -60,2 +61,3 @@ "encoding": "^0.1.13", | ||
"nyc": "^10.3.2", | ||
"object-inspect": "^1.13.4", | ||
"safe-publish-latest": "^2.0.0", | ||
@@ -62,0 +64,0 @@ "tape": "^5.9.0", |
'use strict'; | ||
var test = require('tape'); | ||
var isBoolean = require('../'); | ||
var hasToStringTag = require('has-tostringtag/shams')(); | ||
var inspect = require('object-inspect'); | ||
var isBoolean = require('../'); | ||
test('not Booleans', function (t) { | ||
@@ -51,1 +53,22 @@ t.test('primitives', function (st) { | ||
}); | ||
test('Proxy', { skip: typeof Proxy !== 'function' || !hasToStringTag }, function (t) { | ||
/** @type {Record<PropertyKey, unknown>} */ | ||
var target = {}; | ||
target[Symbol.toStringTag] = 'Boolean'; | ||
var fake = new Proxy(target, { has: function () { return false; } }); | ||
t.equal( | ||
isBoolean(target), | ||
false, | ||
inspect(target) + ' is not a Boolean' | ||
); | ||
t.equal( | ||
isBoolean(fake), | ||
false, | ||
inspect(fake) + ' is not a Boolean' | ||
); | ||
t.end(); | ||
}); |
26486
98
18
+ Addedcall-bind-apply-helpers@1.0.1(transitive)
- Removedcall-bind-apply-helpers@1.0.2(transitive)
Updatedcall-bound@^1.0.3