@techmely/utils
Version:
Collection of helpful JavaScript / TypeScript utils
37 lines (35 loc) • 2.06 kB
text/typescript
declare function isNotNull<T>(v: T | null): v is Exclude<T, null>;
declare function isArray<T = unknown>(val: any): val is T[];
declare function isPrimitive(value: unknown): boolean;
declare const isDef: <T = any>(val?: T | undefined) => val is T;
declare const isUndef: <T = any>(val?: T | undefined) => val is T;
declare const isBoolean: (val: any) => val is boolean;
declare const isFunction: (val: any) => boolean;
declare const isNumber: (val: any) => val is number;
declare const isString: (val: unknown) => val is string;
declare const isObject: (val: any) => val is object;
declare const isMap: (val: unknown) => val is Map<any, any>;
declare const isSet: (val: unknown) => val is Set<any>;
declare const isDate: (val: unknown) => val is Date;
declare const isSymbol: (val: unknown) => val is symbol;
declare const isPromise: <T = any>(val: unknown) => val is Promise<T>;
declare const isFalsy: (val: any) => val is false | null | undefined;
declare const isStream: (val: any) => boolean;
declare const isBrowser: boolean;
declare function isEmpty<T = unknown>(val: T): boolean;
declare function isNotEmpty<T = unknown>(val: T): boolean;
declare function isNotEmpties(...args: any[]): boolean;
declare function isEmpties(...args: any[]): boolean;
declare function isPngImage(buffer: Buffer | Uint8Array): boolean;
declare const isBase64: RegExp;
declare const isAndroid: boolean;
declare const isMobile: boolean | undefined;
declare const isCrawler: boolean;
declare const isCI: boolean;
declare const isNodeTest: boolean;
declare const isNodeProd: boolean;
declare const isNodeDev: boolean;
declare const isWindows: boolean;
declare const isLinux: boolean;
declare const isMacOS: boolean;
export { isAndroid, isArray, isBase64, isBoolean, isBrowser, isCI, isCrawler, isDate, isDef, isEmpties, isEmpty, isFalsy, isFunction, isLinux, isMacOS, isMap, isMobile, isNodeDev, isNodeProd, isNodeTest, isNotEmpties, isNotEmpty, isNotNull, isNumber, isObject, isPngImage, isPrimitive, isPromise, isSet, isStream, isString, isSymbol, isUndef, isWindows };