Comparing version 0.2.0 to 0.3.0
@@ -9,2 +9,3 @@ const ESCAPE = /[&"<]/g, CHARS = { | ||
const CURLY = /{{{?\s*([\s\S]*?)\s*}}}?/g; | ||
const VAR = /(?:^|[-*+^|%/&=\s])([a-zA-Z$_][\w$]*)(?:(?=$|[-*+^|%/&=\s]))/g; | ||
const ARGS = /([a-zA-Z$_][^\s=]*)\s*=\s*((["`'])(?:(?=(\\?))\4.)*?\3|{[^}]*}|\[[^\]]*]|\S+)/g; | ||
@@ -93,6 +94,10 @@ | ||
else throw new Error(`Expected to close "${inner}" block; closed "${action}" instead`); | ||
} else if (match[0].charAt(2) === '{') { | ||
wip += '${' + inner + '}'; // {{{ raw }}} | ||
} else { | ||
wip += '${$$1(' + inner + ')}'; | ||
if (match[0].charAt(2) === '{') wip += '${' + inner + '}'; // {{{ raw }}} | ||
else wip += '${$$1(' + inner + ')}'; | ||
if (options.loose) { | ||
while (tmp = VAR.exec(inner)) { | ||
initials.add(tmp[1]); | ||
} | ||
} | ||
} | ||
@@ -99,0 +104,0 @@ } |
@@ -6,2 +6,3 @@ export type Args = Record<string, any>; | ||
export interface Options { | ||
loose?: boolean; | ||
props?: string[]; | ||
@@ -8,0 +9,0 @@ blocks?: Blocks; |
{ | ||
"name": "tempura", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"repository": "lukeed/tempura", | ||
@@ -5,0 +5,0 @@ "description": "A light, crispy, and delicious template engine", |
@@ -25,3 +25,3 @@ <div align="center"> | ||
* **Extremely lightweight**<br> | ||
_Everything is `1.22 kB` (gzip) – even less with tree-shaking!_ | ||
_Everything is `1.23 kB` (gzip) – even less with tree-shaking!_ | ||
@@ -28,0 +28,0 @@ * **Super Performant**<br> |
Sorry, the diff of this file is not supported yet
22874
520