UNPKG

@scania/tegel

Version:
15 lines (14 loc) 483 B
/** * Converts a value (string or number) to string * @param value - The value to convert * @returns The string representation of the value, or empty string if null/undefined */ export const convertToString = (value) => { if (value === null || value === undefined) return ''; return value.toString(); }; // Optional: If we need array conversion often export const convertArrayToStrings = (values) => { return values.map((value) => convertToString(value)); };