UNPKG

@nodesecure/utils

Version:
12 lines 487 B
export function taggedString(strings, ...keys) { return function cur(...values) { const lastVal = values[values.length - 1]; const dict = typeof lastVal === "object" && lastVal !== null ? lastVal : {}; const result = [strings[0]]; keys.forEach((key, index) => { result.push(typeof key === "number" ? values[key] : dict[key], strings[index + 1]); }); return result.join(""); }; } //# sourceMappingURL=taggedString.js.map