forked from orbit-oss/is
Minor tweaks
This commit is contained in:
parent
e0976457e0
commit
47a5099325
1 changed files with 3 additions and 0 deletions
|
|
@ -456,6 +456,7 @@ export function isEnumCase<T = unknown>(value: unknown, targetEnum: T): value is
|
|||
}
|
||||
|
||||
export function isError(value: unknown): value is Error {
|
||||
// TODO: Use `Error.isError` when targeting Node.js 24.`
|
||||
return getObjectType(value) === 'Error';
|
||||
}
|
||||
|
||||
|
|
@ -468,6 +469,8 @@ export function isFalsy(value: unknown): value is Falsy {
|
|||
return !value;
|
||||
}
|
||||
|
||||
// TODO: Support detecting Float16Array when targeting Node.js 24.
|
||||
|
||||
export function isFloat32Array(value: unknown): value is Float32Array {
|
||||
return getObjectType(value) === 'Float32Array';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue