Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@blackglory/types
Advanced tools
Type guards for JavaScript and Typescript.
npm install --save @blackglory/types
# or
yarn add @blackglory/types
function isArray<T>(val: unknown): val is Array<T>
function isntArray<T>(val: T): val is Exclude<T, Array<unknown>>
function isEmptyArray(val: unknown[]): boolean
function isntEmptyArray(val: unknown[]): boolean
function isAsyncIterable<T>(val: unknown): val is AsyncIterable<T>
function isntAsyncIterable<T>(val: T): val is Exclude<T, AsyncIterable<unknown>>
function isBigInt(val: unknown): val is bigint
function isntBigInt<T>(val: T): val is Exclude<T, bigint>
function isBoolean(val: unknown): val is boolean
function isChar(val: unknown): val is string
function isntChar(val: unknown): boolean
function isDate(val: unknown): val is Date
function isntDate<T>(val: T): val is Exclude<T, Date>
function inEnum<T>(val: unknown, _enum: object): val is T
function isError(val: unknown): val is Error
function isntError<T>(val: T): val is Exclude<T, Error>
function isFalsy(val: unknown): val is Falsy
function isntFalsy<T>(val: T): val is Exclude<T, Falsy>
function isFunction<T extends Function = (...args: any[]) => any>(
val: unknown
): val is T
function isntFunction<T>(val: T): val is Exclude<T, Function>
function isIterable<T>(val: unknown): val is Iterable<T>
function isntIterable<T>(val: T): val is Exclude<T, Iterable<unknown>>
function isJson(val: unknown): Json
function isntJson<T>(val: T): val is Exclude<T, Json>
function isJsonable(val: unknown): boolean
function isntJsonable<T>(val: T): boolean
function isNull(val: unknown): val is null
function isntNull<T>(val: T): val is Exclude<T, null>
function isNumber(val: unknown): val is number
function isntNumber<T>(val: T): val is Exclude<T, number>
function isObject(val: unknown): val is object & Record<string | symbol | number, unknown>
function isntObject<T>(val: T): val is Exclude<T, object & Record<string | symbol | number, unknown>>
function isPlainObject(val: unknown): val is object & Record<string | symbol | number, unknown>
function isntPlainObject<T>(val: T): val is Exclude<T, object & Record<string | symbol | number, unknown>>
function isEmptyObject(val: object): boolean
function isntEmptyObject(val: object): boolean
function isPromise<T>(val: unknown): val is Promise<T>
function isntPromise<T>(val: T): val is Exclude<T, Promise<unknown>>
function isntPromiseLike<T>(val: T): val is Exclude<T, PromiseLike<unknown>>
function isPromiseLike<T>(val: unknown): val is PromiseLike<T>
function isString(val: unknown): val is string
function isntString<T>(val: T): val is Exclude<T, string>
function isUndefined(val: unknown): val is undefined
function isntUndefined<T>(val: T): val is Exclude<T, undefined>
function isAbsoluteURL(str: string): boolean
FAQs
Type guards for JavaScript and Typescript.
The npm package @blackglory/types receives a total of 160 weekly downloads. As such, @blackglory/types popularity was classified as not popular.
We found that @blackglory/types 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.