Permalink
Cannot retrieve contributors at this time
38 lines (34 sloc)
737 Bytes
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/is-bigint/index.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var hasBigInts = require('has-bigints')(); | |
if (hasBigInts) { | |
var bigIntValueOf = BigInt.prototype.valueOf; | |
var tryBigInt = function tryBigIntObject(value) { | |
try { | |
bigIntValueOf.call(value); | |
return true; | |
} catch (e) { | |
} | |
return false; | |
}; | |
module.exports = function isBigInt(value) { | |
if ( | |
value === null | |
|| typeof value === 'undefined' | |
|| typeof value === 'boolean' | |
|| typeof value === 'string' | |
|| typeof value === 'number' | |
|| typeof value === 'symbol' | |
|| typeof value === 'function' | |
) { | |
return false; | |
} | |
if (typeof value === 'bigint') { | |
return true; | |
} | |
return tryBigInt(value); | |
}; | |
} else { | |
module.exports = function isBigInt(value) { | |
return false && value; | |
}; | |
} |