@overture-stack/lyric
Version:
Data Submission system
41 lines (40 loc) • 1.67 kB
TypeScript
export declare const isEmptyString: (value: unknown) => boolean;
export declare const isArrayWithValues: (value: unknown) => boolean;
export declare function notEmpty<TValue>(value: TValue | null | undefined): value is TValue;
export declare function isNumber(value: unknown): value is number;
export declare function uniqueCharacters(value: string): string;
/**
* Function that returns true if input is a valid number greater than zero.
* Otherwise it returns false
* @param {unknown} value
* @returns {boolean}
*/
export declare function isValidIdNumber(value: unknown): boolean;
/**
* Checks if a given string is a valid date format.
*
* This function attempts to parse the input string into a timestamp.
* If the parsing is successful and the result is a valid date, it returns `true`.
* Otherwise, it returns `false`.
*
* @param {string} value
* @returns {boolean}
*/
export declare function isValidDateFormat(value: string): boolean;
/**
* Ensure a value is wrapped in an array.
*
* If passed an array, return it returns the same array. If passed a single item, wrap it in an array.
* The function then filters out any empty strings and `undefined` values
* @param val an item or array
* @return an array
*/
export declare const asArray: <T>(val: T | T[]) => T[];
/**
* Performs a deep comparison between two values to determine if they are deeply equal.
* @param obj1 The first value to compare.
* @param obj2 The second value to compare.
* @returns
*/
export declare const deepCompare: (obj1: unknown, obj2: unknown) => boolean;
export declare const convertRecordToString: (record: Record<string, unknown>) => Record<string, string>;