type-core
v0.15.0
Published
A types utility belt
Downloads
3,605
Readme
type-core
A types utility belt.
Install
Types
ID
VoidLike
NullLike
FalseLike
Primitive
Serial
Dictionary
Promisable
Callable
Multiary
- Utils
Union
Intersection
KeyOf
ValueOf
Index
Replace
Optional
Deep.Required
Deep.Partial
Utilities
TypeGuard
An exported object with methods:
isID(item: any): item is ID
: includes string and number.isNullLike(item: any): item is NullLike
.isFalseLike(item: any): item is FalseLike
isPrimitive(item: any): item is Primitive
: includes bigint, boolean, number, string, symbol, null, and undefined.isNull(item: any): item is null
isUndefined(item: any): item is undefined
isBoolean(item: any): item is boolean
isString(item: any): item is string
isNumber(item: any): item is number
isBigInt(item: any): item is bigint
isSymbol(item: any): item is symbol
isFunction(item: any): item is VariadicFn
isObject(item: any): item is any
: excludes null, includes array.isRecord(item: any): item is Members<unknown>
: excludes null, array, and function.isArray(item: any): item is unknown[]
isPromiseLike(item: any): item is PromiseLike<unknown>
: item is a thenable.isPromise(item: any): item is Promise<unknown>
: item is a Promise.isIterable(item: any): item is Iterable<unknown>
isAsyncIterable(item: any): item is AsyncIterable<unknown>
isIterator(item: any): item is Iterator<unknown, unknown, unknown>
isEventEmitterLike(item: any): item is Partial<NodeJS.EventEmitter>
isEventEmitter(item: any): item is NodeJS.EventEmitter
isEventTarget(item: any): item is EventTarget