Gathering detailed insights and metrics for is-type-of
Gathering detailed insights and metrics for is-type-of
Gathering detailed insights and metrics for is-type-of
Gathering detailed insights and metrics for is-type-of
npm install is-type-of
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
123 Stars
61 Commits
13 Forks
14 Watching
2 Branches
27 Contributors
Updated on 21 Oct 2024
TypeScript (78.87%)
JavaScript (21.13%)
Cumulative downloads
Total Downloads
Last day
-11.8%
71,506
Compared to previous day
Last week
2.7%
486,043
Compared to previous week
Last month
10.6%
1,989,011
Compared to previous month
Last year
35.6%
17,499,040
Compared to previous year
Complete type checking for Node
1npm install is-type-of
Use ES Module import
1import is from 'is-type-of'; 2import { isArray } from 'is-type-of'; 3 4isArray([]); // => true 5is.array([]); // => true
Compatible With
1const is = require('is-type-of'); 2 3is.array([1]); // => true 4is.primitive(true); // => true 5is.primitive({}); // => false 6is.generatorFunction(function * () {}); // => true 7is.long(Math.pow(2, 33)); // => true 8is.double(0); // => false
Use Type Guard
1import { isArray } from 'is-type-of'; 2 3function checkArray(arr: string[] | string) { 4 // => parameter) arr: string | string[] 5 if (isArray(arr)) { 6 // => (parameter) arr: string[] 7 arr.forEach(console.log); 8 } 9}
Returns true if val
is string, not String
object.
See Also is.string
Returns true if val
is number, not Number
object.
See Also is.number
Returns true if val
is boolean, not Boolean
object.
See Also is.boolean
Returns true if val
is bigint.
See Also is.bigInt
Returns true if val
is symbol.
See Also is.symbol
Returns true if val
is undefined.
See Also is.undefined
Returns true if val
is null.
See Also is.null
Returns true if val
is null or undefined.
See Also is.nullable
Returns true if val
is primitive.
See Also is.primitive
Returns true if val
is integer.
See Also is.integer
Returns true if val
is integer, and between -2 ** 31
and 2 ** 31 - 1
.
See Also is.integer32
Returns true if val
is integer, and < -2 ** 31
, and > 2 ** 31 - 1
.
See Also is.long
Returns true if val
is integer, and between -(2 ** 53 - 1)
and 2 ** 53 - 1
.
See Also is.safeInteger
Returns true if val
is Double.
See Also is.double
Returns true if val
is NaN.
See Also is.NaN
Returns true if val
is finite.
See Also is.finite
Returns true if val
is array, it won't check items of array.
See Also is.array
Returns true if val
is function.
See Also is.function
Returns true if val
is generator function.
See Also is.generatorFunction
Returns true if val
is async function.
See Also is.asyncFunction
Returns true if val
is async generator function.
See Also is.asyncGeneratorFunction
Returns true if val
is object.
See Also is.object
Returns true if val
is class.
Note: "class" is supported in ECMAScript 6, and if the code is using some compiler or transpiler, the checking might fail.
See Also is.class
Returns true if val
is regular expression.
See Also is.regExp
Returns true if val
is instance of Date.
See Also is.date
Returns true if val
is instance of Error.
See Also is.error
Returns true if val
is generator.
See Also is.generator
Returns true if val
is promise.
See Also is.promise
Returns true if val
is like promise, if the object has then
property, the checking will pass.
See Also is.promiseLike
Returns true if val
is buffer.
See Also is.buffer
Returns true if val
is stream.
See Also is.stream
Returns true if val
is readable stream.
See Also is.readable
Returns true if val
is write stream.
See Also is.writable
Returns true if val
is duplex stream.
See Also is.duplex
returns true if val is LongObject
LongObject is from npm package long
See Also is.longObject
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 6/25 approved changesets -- score normalized to 2
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More