refactor start
This commit is contained in:
parent
bd49791e06
commit
e46d25f0b7
16699 changed files with 2 additions and 1484887 deletions
26
home/ags/node_modules/is-boolean-object/index.js
generated
vendored
26
home/ags/node_modules/is-boolean-object/index.js
generated
vendored
|
|
@ -1,26 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
var callBound = require('call-bind/callBound');
|
||||
var $boolToStr = callBound('Boolean.prototype.toString');
|
||||
var $toString = callBound('Object.prototype.toString');
|
||||
|
||||
var tryBooleanObject = function booleanBrandCheck(value) {
|
||||
try {
|
||||
$boolToStr(value);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
var boolClass = '[object Boolean]';
|
||||
var hasToStringTag = require('has-tostringtag/shams')();
|
||||
|
||||
module.exports = function isBoolean(value) {
|
||||
if (typeof value === 'boolean') {
|
||||
return true;
|
||||
}
|
||||
if (value === null || typeof value !== 'object') {
|
||||
return false;
|
||||
}
|
||||
return hasToStringTag && Symbol.toStringTag in value ? tryBooleanObject(value) : $toString(value) === boolClass;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue