mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 12:20:40 -07:00
fix: sort filter unexpectedly modifies original array, #475
This commit is contained in:
@@ -138,6 +138,10 @@ describe('filters/array', function () {
|
||||
const c = { name: { first: 'Carol' } }
|
||||
return test(tpl, { arr: [b, c, a, c] }, 'Alice Bob Carol Carol')
|
||||
})
|
||||
it('should not change the original array', () => {
|
||||
const arr = ["one", "two", "three", "four", "five"]
|
||||
return test("{{arr | sort}} {{arr}}", { arr }, 'fivefouronethreetwo onetwothreefourfive')
|
||||
})
|
||||
})
|
||||
describe('uniq', function () {
|
||||
it('should uniq string list', function () {
|
||||
|
||||
Reference in New Issue
Block a user