Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/froebel/path.ts>select

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