Skip to content

Commit

Permalink
feat: add map function (#1)
Browse files Browse the repository at this point in the history
Release-As: 1.0.0-rc.1
  • Loading branch information
rowan-gud authored Feb 28, 2024
1 parent 34d56a3 commit aaf06d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/fp/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from "./pipe";
export * from './map';
export * from './pipe';
6 changes: 6 additions & 0 deletions src/fp/map.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export function map<T extends any[], Res>(
fn: (item: T[number]) => Res,
items: T,
): Res[] {
return items.map(fn);
}

0 comments on commit aaf06d3

Please sign in to comment.