Interface API
isCtorName(target: unknown, types: string | Set<string>): boolean;
isDate(target: unknown): target is Date;
isError(target: unknown): target is Error;
isMap(target: unknown): target is Map<unknown, unknown>;
isPromise(target: unknown): target is Promise<unknown>;
isRegExp(target: unknown): target is RegExp;
isSet(target: unknown): target is Set<unknown>;
}
Methods
isCtorName
-
Parameters
- target: unknown
Object to test for constructor name.
- types: string | Set<string>
Specific constructor name or Set of constructor names to match.
Returns boolean
Does the provided object constructor name match the types provided.
- target: unknown
isDate
-
Provides basic prototype string type checking if
targetis a Date.Parameters
- target: unknown
A potential Date to test.
Returns target is Date
Is
targeta Date. - target: unknown
isError
-
Provides detection via
Error.isErrorwhere available or basic prototype string type checking iftargetis an Error.Parameters
- target: unknown
A potential Error to test.
Returns target is Error
Is
targetan Error. - target: unknown
isMap
-
Provides basic prototype string type checking if
targetis a Map.Parameters
- target: unknown
A potential Map to test.
Returns target is Map<unknown, unknown>
Is
targeta Map. - target: unknown
isPromise
-
Provides basic prototype string type checking if
targetis a Promise.Parameters
- target: unknown
A potential Promise to test.
Returns target is Promise<unknown>
Is
targeta Promise. - target: unknown
isRegExp
-
Provides basic prototype string type checking if
targetis a RegExp.Parameters
- target: unknown
A potential RegExp to test.
Returns target is RegExp
Is
targeta RegExp. - target: unknown
isSet
-
Provides basic prototype string type checking if
targetis a Set.Parameters
- target: unknown
A potential Set to test.
Returns target is Set<unknown>
Is
targeta Set. - target: unknown
Provides basic type checking by constructor name(s) for objects. This can be useful when checking multiple constructor names against a provided Set.