@nodesecure/utils
Version:
NodeSecure utilities
12 lines • 487 B
JavaScript
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