fix: "filter is not a function" for uniq

This commit is contained in:
Yang Jun
2024-08-23 21:27:53 +08:00
committed by Jun Yang
parent 2d59cff0a6
commit 68387c31ea
5 changed files with 22 additions and 14 deletions
+8 -3
View File
@@ -496,9 +496,14 @@ describe('Issues', function () {
expect(() => liquid.parse({} as any)).not.toThrow()
})
it('Unexpected "RenderError: memory alloc limit exceeded" #737', () => {
const liquid = new Liquid();
const context = { x: ["a", "b"] };
const template = "{{ x | join: 5 }}"
const liquid = new Liquid()
const context = { x: ['a', 'b'] }
const template = '{{ x | join: 5 }}'
expect(liquid.parseAndRender(template, context)).resolves.toEqual('a5b')
})
it('{{ 123 | uniq }} throws #737', () => {
const liquid = new Liquid()
expect(liquid.parseAndRender('{{ 113 | uniq }}')).resolves.toEqual('113')
expect(liquid.parseAndRender("{{ '113' | uniq }}")).resolves.toEqual('113')
})
})