UNPKG

rambdax

Version:

Extended version of Rambda - a lightweight, faster alternative to Ramda

12 lines (9 loc) 261 B
import { curry } from './curry.js' import { defaultTo } from './defaultTo.js' import { path } from './path.js' function pathOrFn( defaultValue, pathInput, obj ){ return defaultTo(defaultValue, path(pathInput, obj)) } export const pathOr = curry(pathOrFn)