Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rambda/mod.ts>propOr

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

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; }