mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 04:10:40 -07:00
perf: add cross-engines benchmark
This commit is contained in:
@@ -7,12 +7,12 @@ import { stringify } from '../../util/underscore'
|
||||
import { assert } from '../../util/assert'
|
||||
|
||||
export function append (v: string, arg: string) {
|
||||
assert(arg !== undefined, () => 'append expect 2 arguments')
|
||||
assert(arguments.length === 2, () => 'append expect 2 arguments')
|
||||
return stringify(v) + stringify(arg)
|
||||
}
|
||||
|
||||
export function prepend (v: string, arg: string) {
|
||||
assert(arg !== undefined, () => 'prepend expect 2 arguments')
|
||||
assert(arguments.length === 2, () => 'prepend expect 2 arguments')
|
||||
return stringify(arg) + stringify(v)
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ export default {
|
||||
render: function * (ctx: Context, emitter: Emitter) {
|
||||
const { liquid, hash, withVar, file } = this
|
||||
const { renderer } = liquid
|
||||
// TODO try move all liquid.parse calls into parse() section
|
||||
const filepath = ctx.opts.dynamicPartials
|
||||
? (TypeGuards.isQuotedToken(file)
|
||||
? yield renderer.renderTemplates(liquid.parse(evalQuotedToken(file)), ctx)
|
||||
|
||||
Reference in New Issue
Block a user