Files
NapCatQQ/.pnpm-store/v3/files/09/0fcc204c2b6566e2f4735efc7eb8127131f3147f8e5083f3b9806f223df505a620118305a0dd33073782d76cbeb326aad242c122dfc96dd6ef5df5a53a1738
T
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

23 lines
614 B
Plaintext

/**
* Ensure the type of a value
*
* 确认类型
*
* @example
* ```js
* import { ensureType } from 'is-what-type';
*
* const value: string | number | boolean | null | undefined | symbol | bigint = null;
const whatType = typeof value;
if (ensureType<object>(value, whatType === 'object')) {
Object.keys(value); // Throws TypeError: Cannot convert undefined or null to object
}
* ```
*
* @param value - The value to check
* @param checked - If the type is already checked
* @returns
*/
export declare function ensureType<T = unknown>(value: unknown, checked: boolean): value is T;