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
+1 -6
View File
@@ -1,6 +1,5 @@
import { Value } from './value'
import { FilterMap } from './filter/filter-map'
import { stringify, toValue } from '../util/underscore'
import { TemplateImpl } from '../template/template-impl'
import { Template } from '../template/template'
import { Context } from '../context/context'
@@ -16,10 +15,6 @@ export class Output extends TemplateImpl<OutputToken> implements Template {
}
public * render (ctx: Context, emitter: Emitter) {
const val = yield this.value.value(ctx)
if (ctx.opts.keepOutputType) {
emitter.write(toValue(val))
} else {
emitter.write(stringify(toValue(val)))
}
emitter.write(val)
}
}