CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
isLength.d.mts25 linesDownload Raw Back to predicate
1/**2 * Checks if a given value is a valid length.3 *4 * A valid length is of type `number`, is a non-negative integer, and is less than or equal to5 * JavaScript's maximum safe integer (`Number.MAX_SAFE_INTEGER`).6 * It returns `true` if the value is a valid length, and `false` otherwise.7 *8 * This function can also serve as a type predicate in TypeScript, narrowing the type of the9 * argument to a valid length (`number`).10 *11 * @param {any} value The value to check.12 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.13 *14 * @example15 * isLength(0); // true16 * isLength(42); // true17 * isLength(-1); // false18 * isLength(1.5); // false19 * isLength(Number.MAX_SAFE_INTEGER); // true20 * isLength(Number.MAX_SAFE_INTEGER + 1); // false21 */22declare function isLength(value?: any): boolean;23 24export { isLength };25 
basant307/AI_Governance_Project · CoolFace