mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 04:40:39 -07:00
feat: support json filter, closes #192
This commit is contained in:
@@ -4,5 +4,8 @@ import { toValue } from '../../util/underscore'
|
||||
export default {
|
||||
'default': function<T1, T2> (v: string | T1, arg: T2): string | T1 | T2 {
|
||||
return isFalsy(toValue(v)) || v === '' ? arg : v
|
||||
},
|
||||
'json': function (v: any) {
|
||||
return JSON.stringify(v)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user