diff --git a/src/fp/index.ts b/src/fp/index.ts index 66ab1bd..c40c661 100644 --- a/src/fp/index.ts +++ b/src/fp/index.ts @@ -1 +1,2 @@ -export * from "./pipe"; +export * from './map'; +export * from './pipe'; diff --git a/src/fp/map.ts b/src/fp/map.ts new file mode 100644 index 0000000..9a3493f --- /dev/null +++ b/src/fp/map.ts @@ -0,0 +1,6 @@ +export function map( + fn: (item: T[number]) => Res, + items: T, +): Res[] { + return items.map(fn); +}