@bookbox/core
Version:
Bookbox — e-book format
14 lines (13 loc) • 368 B
JavaScript
export function templateToList(text, ...elements) {
const result = [text[0]];
for (let i = 1; i < text.length; i++) {
result.push(elements[i - 1], text[i]);
}
return result;
}
export function isTemplateParams(args) {
return (args[0] &&
Array.isArray(args[0]) &&
'raw' in args[0] &&
Array.isArray(args[0]['raw']));
}