CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
isPrimitive.d.mts32 linesDownload Raw Back to predicate
1/**2 * Checks whether a value is a JavaScript primitive.3 * JavaScript primitives include null, undefined, strings, numbers, booleans, symbols, and bigints.4 *5 * @param {unknown} value The value to check.6 * @returns {value is7 *     null8 *   | undefined9 *   | string10 *   | number11 *   | boolean12 *   | symbol13 *   | bigint} Returns true if `value` is a primitive, false otherwise.14 *15 * @example16 * isPrimitive(null); // true17 * isPrimitive(undefined); // true18 * isPrimitive('123'); // true19 * isPrimitive(false); // true20 * isPrimitive(true); // true21 * isPrimitive(Symbol('a')); // true22 * isPrimitive(123n); // true23 * isPrimitive({}); // false24 * isPrimitive(new Date()); // false25 * isPrimitive(new Map()); // false26 * isPrimitive(new Set()); // false27 * isPrimitive([1, 2, 3]); // false28 */29declare function isPrimitive(value: unknown): value is null | undefined | string | number | boolean | symbol | bigint;30 31export { isPrimitive };32 
basant307/AI_Governance_Project · CoolFace