Merge branch 'mapIf-available'

This commit is contained in:
Yanick Champoux 2024-02-27 14:05:31 -05:00
commit c7281022df
3 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
"@yanick/updeep-remeda": patch
---
actually make mapIf and mapIfElse accessible.

View File

@ -13,6 +13,7 @@ import filter from "./filter.js";
import reject from "./reject.js";
import matches from "./matches.js";
import myMap from "./map.js";
import mapIf, { mapIfElse } from "./mapIf.js";
const functions = {
constant,
@ -31,6 +32,8 @@ const functions = {
skip,
update,
updateIn,
mapIf,
mapIfElse,
};
export {
@ -50,6 +53,8 @@ export {
skip,
matches,
myMap as map,
mapIf,
mapIfElse,
};
const merged = update;

View File

@ -180,3 +180,8 @@ test("deep equality", () => {
expect(u(deepOrig, [1, 2, [3, 4]])).toBe(deepOrig);
});
test("expect mapIf and mapIfElse to be present", () => {
expect(u.mapIf).toBeTypeOf("function");
expect(u.mapIfElse).toBeTypeOf("function");
});