CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-is-js

Micro check library providing comprehensive type checking and validation operations across different JavaScript environments

Pending
Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

presence-checking.mddocs/

Presence Checking

Functions for checking value existence, truthiness, and basic state validation.

Capabilities

Empty Check

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);      // true

Existy Check

Checks 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); // true

Falsy Check

Checks 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); // true

Truthy Check

Checks 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); // true

Space Check

Checks 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

docs

collection-validation.md

configuration.md

date-time.md

environment-detection.md

index.md

numeric-operations.md

pattern-matching.md

presence-checking.md

string-checking.md

type-checking.md

tile.json