Skip to content

Commit a01e2be

Browse files
committed
optimize for \n line breaks in micro-template.js (reduce string concatenation)
1 parent 2e00ef9 commit a01e2be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/micro-template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const template = function (id, data) {
1818
(
1919
part = part.replace(/\\/g, "\\\\")
2020
.replace(/'/g, "\\'")
21-
.replace(/\n|\r\n/g, () => `\\n';\n__this.line = ${++line}; __this.ret += '`),
21+
.replace(/\n|\r\n/g, () => `';\n__this.line = ${++line}; __this.ret += '\\n`),
2222
part ? `/*+*/__this.ret+='${part}';` : ''
2323
)
2424
).join('') +

0 commit comments

Comments
 (0)