mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-17 21:40:39 -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,15 @@
|
||||
import Template from 'src/template/template'
|
||||
import Scope from 'src/scope/scope'
|
||||
import ITemplate from 'src/template/itemplate'
|
||||
import Token from 'src/parser/token'
|
||||
|
||||
export default class extends Template implements ITemplate {
|
||||
str: string
|
||||
constructor(token: Token) {
|
||||
super(token)
|
||||
this.str = token.value
|
||||
}
|
||||
async render(scope: Scope): Promise<string> {
|
||||
return this.str
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user