Files
SnowLuma/.pnpm-store/v11/files/c7/1710320dc1dc89e78ad15eb612f511ba9ab232e5962f63967c164d397af33390258d98e66b8319f9c334427441028dd359d33ae06f1f969ff87da46cb3e5fd
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

24 lines
686 B
Plaintext

/**
* Check if the value is what you want
*
* 校验是否是想要的类型
*
* @example
* ```js
* import { isWhat } from 'is-what-type';
*
* const value: string | number | boolean | null | undefined | symbol | bigint = null;
const whatType = typeof value;
if (isWhat<object>(value, whatType, 'object')) {
Object.keys(value); // Throws TypeError: Cannot convert undefined or null to object
}
* ```
*
* @param value - The value to check
* @param type - The type of the value
* @param comparingType - The type to compare with
* @returns
*/
export declare function isWhat<T = unknown>(value: unknown, type: unknown, comparingType: unknown): value is T;