
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
is-type-of
Advanced tools
Complete type checking for Node
npm install is-type-of
Use ES Module import
import is from 'is-type-of';
import { isArray } from 'is-type-of';
isArray([]); // => true
is.array([]); // => true
Compatible With
const is = require('is-type-of');
is.array([1]); // => true
is.primitive(true); // => true
is.primitive({}); // => false
is.generatorFunction(function * () {}); // => true
is.long(Math.pow(2, 33)); // => true
is.double(0); // => false
Use Type Guard
import { isArray } from 'is-type-of';
function checkArray(arr: string[] | string) {
// => parameter) arr: string | string[]
if (isArray(arr)) {
// => (parameter) arr: string[]
arr.forEach(console.log);
}
}
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
Made with contributors-img.
FAQs
complete type checking for node
We found that is-type-of demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.