chore: workspace improvements (#282)

This commit is contained in:
rahim
2026-01-04 01:39:26 +11:00
committed by GitHub
parent d74e4e6701
commit 2901593085
77 changed files with 2085 additions and 573 deletions
+48
View File
@@ -0,0 +1,48 @@
export function isString(value: unknown): value is string {
return typeof value === 'string';
}
export function isNumber(value: unknown): value is number {
return typeof value === 'number';
}
export function isBoolean(value: unknown): value is boolean {
return typeof value === 'boolean';
}
export function isFunction(value: unknown): value is (...args: any[]) => any {
return typeof value === 'function';
}
export function isNull(value: unknown): value is null {
return value === null;
}
export function isUndefined(value: unknown): value is undefined {
return typeof value === 'undefined';
}
export function isNil(value: unknown): value is null | undefined {
return value == null;
}
export function isPromise(value: unknown): value is Promise<any> {
return value instanceof Promise;
}
/**
* Check if a value is an object, excluding null.
*/
export function isObject(value: unknown): value is object {
return value !== null && typeof value === 'object';
}
/**
* Check if a value is an AbortError.
*/
export function isAbortError(value: unknown): value is Error {
return (
value instanceof Error
&& value.name === 'AbortError'
);
}