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

x/i18next/utils.js>deepFind

i18next: learn once - translate everywhere
Latest
variable deepFind
import { deepFind } from "https://deno.land/x/i18next@v23.16.5/utils.js";

Given

  1. a top level object obj, and
  2. a path to a deeply nested string or object within it

Find and return that deeply nested string or object. The caveat is that the keys of objects within the nesting chain may contain period characters. Therefore, we need to DFS and explore all possible keys at each step until we find the deeply nested string or object.

type

(
obj,
path,
keySeparator?,
) => unknown