Micro check library providing comprehensive type checking and validation operations across different JavaScript environments
—
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Pending
The risk profile of this skill
Functions for checking value existence, truthiness, and basic state validation.
Checks if the given value is empty (works with objects, arrays, and strings).
/**
* Checks if the given value is empty
* @param value - Value to check (array, object, or string)
* @returns True if value is empty
* Interfaces: not, all, any
*/
function empty(value: any): boolean;Usage Example:
is.empty({}); // true
is.empty([]); // true
is.empty(''); // true
is.not.empty(['foo']); // true
is.all.empty('', {}, ['foo']); // false
is.any.empty([], 42); // trueChecks if the given value is existy (not null or undefined).
/**
* Checks if the given value is existy (not null or undefined)
* @param value - Value to check
* @returns True if value is not null or undefined
* Interfaces: not, all, any
*/
function existy(value: any): boolean;Usage Example:
is.existy({}); // true
is.existy(null); // false
is.not.existy(undefined); // true
is.all.existy(null, ['foo']); // false
is.any.existy(undefined, 42); // trueChecks if the given value is falsy.
/**
* Checks if the given value is falsy
* @param value - Value to check
* @returns True if value is falsy
* Interfaces: not, all, any
*/
function falsy(value: any): boolean;Usage Example:
is.falsy(false); // true
is.falsy(null); // true
is.not.falsy(true); // true
is.all.falsy(null, false); // true
is.any.falsy(undefined, true); // trueChecks if the given value is truthy (existy and not false).
/**
* Checks if the given value is truthy
* @param value - Value to check
* @returns True if value is truthy
* Interfaces: not, all, any
*/
function truthy(value: any): boolean;Usage Example:
is.truthy(true); // true
is.truthy(null); // false
is.not.truthy(false); // true
is.all.truthy(null, true); // false
is.any.truthy(undefined, true); // trueChecks if the given value is a whitespace character.
/**
* Checks if the given value is space
* @param value - Value to check
* @returns True if value is whitespace character
* Interfaces: not, all, any
*/
function space(value: any): boolean;Usage Example:
is.space(' '); // true
is.space('foo'); // false
is.not.space(true); // true
is.all.space(' ', 'foo'); // false
is.any.space(' ', true); // true