Releases: asd-xiv/m
Releases · asd-xiv/m
v1.1.0
v1.0.1
v1.0.0
1.0.0 (2019-10-01)
Features
- Update "get" to accept a default value in case path not found (90b0236)
BREAKING CHANGES
Path chain needs to be array. It can also be a single value if accessing a direct property.
//
// Old
//
get("a", "b", "c")({a: {b: {c: "test"}}})
// => "test"
//
// New
//
get(["a", "b", "c"])({a: {b: {c: "test"}}})
// => "test"
This still works:
get("a")({a: {b: "lorem"}})
// => {b: "lorem"}
Added default value in case path does not exist:
get(["a", "b"], "lorem")({a: {c: "ipsum"}})
// => "lorem"
//
// Old
//
pipe(
get(["a", "b"], "lorem"),
when(isNothing, same("lorem"))
)({a: {c: "ipsum"}})
// => "lorem"