mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 04:10:40 -07:00
Add support for the Jekyll push filter
See https://jekyllrb.com/docs/liquid/filters
This commit is contained in:
committed by
Jun Yang
parent
7ceff17fcb
commit
dca9ab52b8
@@ -54,6 +54,10 @@ export function concat<T1, T2> (v: T1[], arg: T2[] = []): (T1 | T2)[] {
|
||||
return toArray(v).concat(arg)
|
||||
}
|
||||
|
||||
export function push<T> (v: T[], arg: T): T[] {
|
||||
return concat(v, [arg])
|
||||
}
|
||||
|
||||
export function slice<T> (v: T[] | string, begin: number, length = 1): T[] | string {
|
||||
v = toValue(v)
|
||||
if (isNil(v)) return []
|
||||
|
||||
Reference in New Issue
Block a user