UNPKG

@bearz/strings

Version:

A collection of string utilities to avoid extra allocations and enable case insensitivity comparisons.

18 lines (17 loc) 577 B
/** * The is-empty module provides functions to check if a string is empty or null. * * @module */ /** * Determines whether the string is empty. * @param s The string to check. * @returns `true` if the string is empty; otherwise, `false`. */ export declare function isEmpty(s: string): s is ""; /** * Determines whether the string is null, undefined, or empty. * @param s The string to check. * @returns `true` if the string is null or undefined or empty; otherwise, `false`. */ export declare function isNullOrEmpty(s?: string | null): s is undefined | null | "";