Skip to main content
Module

x/froebel/mod.ts>select

A strictly typed utility library.
Go to Latest
variable select
import { select } from "https://deno.land/x/froebel@v0.20.0/mod.ts";

Returns the value in obj at path. If the given path does not exist, the symbol none is returned.

Examples

Example 1

// -> 'something'
select(
  { a: { deeply: [{ nested: { object: 'something' } }] } },
  'a', 'deeply', 0, 'nested', 'object'
)

type

<T, P extends (AnyNarrow)[]>(obj: T, ...path: P) => PickPath<T, P>