Skip to content

Commit

Permalink
Add support for the Jekyll push filter
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasHubelbauer authored and harttle committed May 23, 2023
1 parent 7ceff17 commit dca9ab5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/filters/array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 []
Expand Down

0 comments on commit dca9ab5

Please sign in to comment.