UNPKG

rambda

Version:

Lightweight and faster alternative to Ramda with included TS definitions

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)