
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
A collection of user-defined type guards to handle some of Javascript's less-than-ideal behavior.
$ npm install is-js
$ yarn add is-js
▸ array(arg
): arg is any[]
Determines if the argument is an array.
remarks
Defaults to the native Array.isArray
method, if present.
Name | Type |
---|---|
arg | any |
arg is any[]
true
if the given argument is an array
▸ bigint(value
): boolean
Determines if the argument is a BigInt
remarks
This method does not support polyfilled BigInt implementations; please defer
to the library in use to determine the type of an unknown argument.
Name | Type | Description |
---|---|---|
value | unknown | Value in question |
boolean
true
if the given argument is a native BigInt
▸ bool(value
): value is boolean
Determines if the argument is a boolean
Name | Type | Description |
---|---|---|
value | unknown | Value in question |
value is boolean
true
if the given argument is a boolean
▸ date(value
): value is Date
Determines if the argument is a date.
Name | Type | Description |
---|---|---|
value | unknown | Value in question |
value is Date
true
if the given argument is a date
▸ error(value
): value is Error
Determines if the argument is an error.
Name | Type | Description |
---|---|---|
value | unknown | Value in question |
value is Error
true
if the given argument is an error
▸ func(value
): value is Function
Determines if the argument is a function.
Name | Type | Description |
---|---|---|
value | unknown | Value in question |
value is Function
true
if the given argument is a function
▸ nil(value
): value is null
Determines if the argument is null
Name | Type | Description |
---|---|---|
value | unknown | Value in question |
value is null
true
if the given argument is null
▸ number(value
): value is number
Determines if the argument is a number
Name | Type | Description |
---|---|---|
value | unknown | Value in question |
value is number
true
if the given argument is a number
▸ object(value
): value is Object
Determines if the argument is an object.
remarks
Nearly everything in Javascript is an object; this method discerns between
native primitives (e.g. true
, 3
, some text
) and their object-wrapped
variants (Boolean, Number, String)
Name | Type | Description |
---|---|---|
value | unknown | Value in question |
value is Object
true
if the given argument is an object
▸ promise(value
): value is Promise<unknown>
Determines if the argument is a native promise.
remarks
Some libraries and frameworks still include their own polyfilled Promises,
in which case this method is unreliable. If you are using such a library,
please defer to the provided Promise implementation or use promiseLike
Name | Type | Description |
---|---|---|
value | unknown | Value in question |
value is Promise<unknown>
true
if the given argument is a string
▸ promiseLike(value
): value is Object
Determines if the argument conforms to the minimal interface of a Promise;
that is, it has a method named then
.
Name | Type | Description |
---|---|---|
value | unknown | Value in question |
value is Object
true
if the given argument conforms to the Promise interface
▸ regex(value
): value is RegExp
Determines if the argument is a regular expression.
Name | Type | Description |
---|---|---|
value | unknown | Value in question |
value is RegExp
true
if the given argument is a regular expression
▸ string(value
): value is string
Determines if the argument is a string.
Name | Type | Description |
---|---|---|
value | unknown | Value in question |
value is string
true
if the given argument is a string
▸ symbol(value
): value is Symbol
Determines if the argument is a symbol
Name | Type | Description |
---|---|---|
value | unknown | Value in question |
value is Symbol
true
if the given argument is a symbol
▸ undef(value
): value is undefined
Determines if the argument is undefined
Name | Type | Description |
---|---|---|
value | unknown | Value in question |
value is undefined
true
if the given argument is undefined
FAQs
A small library for identifying Javascript types.
The npm package is-js receives a total of 195 weekly downloads. As such, is-js popularity was classified as not popular.
We found that is-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.