perf: introduce AST to avoid reparse

This commit is contained in:
harttle
2020-03-15 02:51:25 +08:00
committed by Jun Yang
parent 3b58f1c3f6
commit d2d6a38235
96 changed files with 1553 additions and 1168 deletions
+15
View File
@@ -0,0 +1,15 @@
import { normalize } from '../../../src/liquid-options'
import { expect } from 'chai'
describe('LiquidOptions#root', function () {
describe('#normalize ()', function () {
it('should normalize string typed root array', function () {
const options = normalize({ root: 'foo' })
expect(options.root).to.eql(['foo'])
})
it('should normalize null typed root as empty array', function () {
const options = normalize({ root: null } as any)
expect(options.root).to.eql([])
})
})
})