untitled notebook

node v10.23.0
version: 1.0.0
endpointsharetweet
const { path, split, defaultTo, compose, applySpec } = require('@meltwater/phi') const obj = { applicant: { firstName: 'Raaj', lastName: null }} const tp = split('.') const getValue = ({pathToValue, defaultValue}) => compose(defaultTo(defaultValue), path(tp(pathToValue))) getValue('applicant.lastName')(obj)
Loading…

no comments

    sign in to comment