mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-19 06:20:38 -07:00
chore(TypeScript): refactor objects into classes
fix: `Nil`(null, undefined) now renders as empty string change: `parser.parseValue()` renamed to `parser.parseOutput` change: registered tags/filters become static and shared across different liquid instances
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import Value from './value'
|
||||
import { stringify } from 'src/util/underscore'
|
||||
import Template from 'src/template/template'
|
||||
import ITemplate from 'src/template/itemplate'
|
||||
import Scope from 'src/scope/scope'
|
||||
|
||||
export default class Output extends Template implements ITemplate {
|
||||
value: Value
|
||||
constructor(token, strict_filters?) {
|
||||
super(token)
|
||||
this.value = new Value(token.value, strict_filters)
|
||||
}
|
||||
async render(scope: Scope) {
|
||||
const html = await this.value.value(scope)
|
||||
return stringify(html)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user