mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 14:00:39 -07:00
fix: corner case for concat filter without argument, #481
This commit is contained in:
@@ -41,8 +41,9 @@ export function compact<T> (this: FilterImpl, arr: T[]) {
|
||||
return toArray(arr).filter(x => !isNil(toValue(x)))
|
||||
}
|
||||
|
||||
export function concat<T1, T2> (v: T1[], arg: T2[]): (T1 | T2)[] {
|
||||
export function concat<T1, T2> (v: T1[], arg: T2[] = []): (T1 | T2)[] {
|
||||
v = toValue(v)
|
||||
arg = toArray(arg).map(v => toValue(v))
|
||||
return toArray(v).concat(arg)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user