|
@@ -56,6 +56,7 @@ const modifier = (key, value, valueModifier) => {
|
|
|
|
|
|
const atPathBeginningWith = prefix => (...keyDescriptions) => {
|
|
const atPathBeginningWith = prefix => (...keyDescriptions) => {
|
|
const keys = parseKeysInto(keyDescriptions, [...prefix]),
|
|
const keys = parseKeysInto(keyDescriptions, [...prefix]),
|
|
|
|
+ atCurrentPath = atPathBeginningWith(keys),
|
|
keyChain = chain(keys),
|
|
keyChain = chain(keys),
|
|
putChain = keyChain((key, next) => x => modifier(key, getKey(x, key), next)(x)),
|
|
putChain = keyChain((key, next) => x => modifier(key, getKey(x, key), next)(x)),
|
|
mapChain = keyChain((key, next) => x => {
|
|
mapChain = keyChain((key, next) => x => {
|
|
@@ -64,7 +65,7 @@ const atPathBeginningWith = prefix => (...keyDescriptions) => {
|
|
return modifier(key, valueWithCheck.value, next)(x);
|
|
return modifier(key, valueWithCheck.value, next)(x);
|
|
});
|
|
});
|
|
|
|
|
|
- return Object.assign(atPathBeginningWith(keys), {
|
|
|
|
|
|
+ return Object.assign(atCurrentPath, {
|
|
get: obj => keys.reduce(getKey, obj),
|
|
get: obj => keys.reduce(getKey, obj),
|
|
put: val => putChain(() => val),
|
|
put: val => putChain(() => val),
|
|
map: mapChain
|
|
map: mapChain
|