Skip to main content
Module

x/rambda/propOr.js

Faster and smaller alternative to Ramda
Go to Latest
File
import { curry } from './curry'import { defaultTo } from './defaultTo'
function propOrFn( defaultValue, property, obj){ if (!obj) return defaultValue
return defaultTo(defaultValue, obj[ property ])}
export const propOr = curry(propOrFn)