fix: address refactor comments

This commit is contained in:
Alex de Wergifosse
2020-12-16 10:20:10 +08:00
committed by Jun Yang
parent b8e4b3337b
commit 6a0ad102a8
8 changed files with 19 additions and 15 deletions
+7
View File
@@ -1,3 +1,5 @@
import { stringify, toValue } from '../util/underscore'
export class Emitter {
public html: any = '';
public break = false;
@@ -9,6 +11,11 @@ export class Emitter {
}
public write (html: any) {
if (this.keepOutputType === true) {
html = toValue(html)
} else {
html = stringify(toValue(html))
}
// This will only preserve the type if the value is isolated.
// I.E:
// {{ my-port }} -> 42