Skip to main content
Module

x/froebel/select.ts>default

A strictly typed utility library.
Latest
variable default
import { default } from "https://deno.land/x/froebel@v0.23.2/select.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>