All files / src/helpers/string to_string.js

50% Statements 4/8
42.85% Branches 3/7
100% Functions 1/1
60% Lines 3/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 62x 6x 6x      
export const toStr = (val, def = "") => {
    Iif (!val) return def;
    Eif (typeof val === "string") return val;
    if (Array.isArray(val)) return val.join("");
    return JSON.stringify(val);
}