Skip to content

Commit

Permalink
Update src/array/replaceOrAppend.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Vladimir Ivakin <vla.ivakin@gmail.com>
  • Loading branch information
aleclarson and Minhir committed Jul 2, 2024
1 parent a587212 commit 0bfd3d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/array/replaceOrAppend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function replaceOrAppend<T>(
const out = array.slice()
for (let index = 0; index < array.length; index++) {
if (match(array[index], index)) {
out.splice(index, 1, newItem)
out[index] = newItem;
return out
}
}
Expand Down

0 comments on commit 0bfd3d2

Please sign in to comment.