refactor: delay creation of operatorsTrie and hide this implementation

BREAKING CHANGE: use `operators` instead of `operatorsTrie` as Tokenizer constructor argument, #500
This commit is contained in:
Jun Yang
2022-11-27 14:04:01 +08:00
parent ff112a4750
commit bb58d3e549
21 changed files with 86 additions and 96 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ export class Value {
* @param str the value to be valuated, eg.: "foobar" | truncate: 3
*/
public constructor (str: string, liquid: Liquid) {
const tokenizer = new Tokenizer(str, liquid.options.operatorsTrie)
const tokenizer = new Tokenizer(str, liquid.options.operators)
this.initial = tokenizer.readExpression()
this.filters = tokenizer.readFilters().map(({ name, args }) => new Filter(name, liquid.filters.get(name), args, liquid))
}