Skip to main content
Module

x/fae/mod.ts>pathOr

A functional module for Deno inspired from Ramda.
Latest
variable pathOr
import { pathOr } from "https://deno.land/x/fae@v1.1.1/mod.ts";

If the given, non-null object has a value at the given path, returns the value at that path. Otherwise returns the provided default value.

 Fae.pathOr('N/A', ['a', 'b'], {a: {b: 2}}); //=> 2
 Fae.pathOr('N/A', ['a', 'b'], {c: {b: 2}}); //=> "N/A"

type

PathOr