@exadel/esl
Version:
Exadel Smart Library (ESL) is the lightweight custom elements library that provide a set of super-flexible components
20 lines (19 loc) • 850 B
TypeScript
/** Parses `null` and `undefined` as an empty string */
export declare const parseString: (val: string | null) => string;
/**
* Serialize to boolean string (`'true'|'false'`)
* Preserve null, undefined and empty string
*/
export declare const toBooleanAttribute: (val: any) => string | null;
/** Parses string representation of the boolean value */
export declare const parseBoolean: (val: string | null) => boolean;
/**
* Parses number with the ability to pass an alternative fallback for NaN.
* Note: falsy values except 0 are treated as NaN
*/
export declare function parseNumber(str: string | number): number | undefined;
/**
* Parses number with the ability to pass an alternative fallback for NaN.
* Note: falsy values except 0 are treated as NaN
*/
export declare function parseNumber(str: string | number, nanValue: number): number;