mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 22:10:41 -07:00
feat: compact filter
This commit is contained in:
@@ -50,6 +50,12 @@ describe('filters/array', function () {
|
||||
return test(tpl, { arr: [a, b, c] }, 'Alice Bob Carol')
|
||||
})
|
||||
})
|
||||
describe('compact', () => {
|
||||
it('should compact array', function () {
|
||||
const posts = [{ category: 'foo' }, { category: 'bar' }, { foo: 'bar' }]
|
||||
return test('{{posts | map: "category" | compact}}', { posts }, 'foo,bar')
|
||||
})
|
||||
})
|
||||
describe('reverse', function () {
|
||||
it('should support reverse', () => test(
|
||||
'{{ "Ground control to Major Tom." | split: "" | reverse | join: "" }}',
|
||||
|
||||
Reference in New Issue
Block a user