mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 14:00:39 -07:00
feat: add option for keeping variable type in output
This commit is contained in:
committed by
Jun Yang
parent
e84fbf32ad
commit
cd92e77726
@@ -16,6 +16,10 @@ export class Output extends TemplateImpl<OutputToken> implements Template {
|
||||
}
|
||||
public * render (ctx: Context, emitter: Emitter) {
|
||||
const val = yield this.value.value(ctx)
|
||||
emitter.write(stringify(toValue(val)))
|
||||
if (ctx.opts.keepOutputType) {
|
||||
emitter.write(toValue(val))
|
||||
} else {
|
||||
emitter.write(stringify(toValue(val)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user