Module

x/rambda/rambda.js>propOr

Faster and smaller alternative to Ramda
Latest
function propOr
import { propOr } from "https://dotland.deno.dev/x/rambda@9.4.1/rambda.js";

It returns either defaultValue or the value of property in obj.

Type Parameters

T
P extends string

Parameters

defaultValue: T
property: P
obj: Partial<Record<P, T>> | undefined

Type Parameters

T
P extends string

Parameters

defaultValue: T
property: P

Returns

(obj: Partial<Record<P, T>> | undefined) => T

Parameters

defaultValue: T

Returns

{ <P extends string>(property: P, obj: Partial<Record<P, T>> | undefined): T; <P extends string>(property: P): (obj: Partial<Record<P, T>> | undefined) => T; }