Create object/pathOr
joelnet opened this issue · comments
joelnet commented
Need to create a function to deep select an object or provide a default value.
Expected
const customer1 = {
address: {
state: 'CA'
}
}
const customer2 = { }
pathOr ('--') ([ 'address', 'state' ]) (customer1) //=> 'CA'
pathOr ('--') ([ 'address', 'state' ]) (customer2) //=> '--'
Acceptance Criteria
object/pathOr.js
is created- unit tests are created.
Tryggvi Gylfason commented
Working on this! Happy Hacktoberfest 🎃
edit here is the PR #244
joelnet commented
excellent work! this has been merged into develop.