fix insertBetween typings
This commit is contained in:
1 parent
b6775d8bab
commit
15cdfc940f
1 file changed
+1
-1
+1
-1
@@ -10,7 +10,7 @@ export function splitBy(fn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function insertBetween<T, I = T>(items: T[], fn: (i: number) => I): Array<T | I> {
|
export function insertBetween<T, I = T>(items: T[], fn: (i: number) => I): Array<T | I> {
|
||||||
return items.reduce((acc, x, i) => {
|
return items.reduce<Array<T | I>>((acc, x, i) => {
|
||||||
acc.push(x)
|
acc.push(x)
|
||||||
|
|
||||||
if (i < items.length - 1) {
|
if (i < items.length - 1) {
|
||||||
|
|||||||
Reference in new issue
Block a user