MCPcopy Create free account
hub / github.com/effect-app/libs / nodeAtJson

Function nodeAtJson

repos/effect/packages/effect/src/ConfigProvider.ts:732–756  ·  view source on GitHub ↗
(root: unknown, path: Path)

Source from the content-addressed store, hash-verified

730 * **When to use**
731 *
732 * Use when you need deterministic config from an in-memory JavaScript value,
733 * such as in tests, embedded config, or parsed JSON.
734 *
735 * **Details**
736 *
737 * Path traversal follows standard JS rules: string segments index into object
738 * keys, numeric segments index into arrays. Returns `undefined` for any
739 * path that cannot be resolved. Never fails with `SourceError`.
740 *
741 * Primitive values (`number`, `boolean`, `bigint`) are stringified via
742 * `String(...)`.
743 *
744 * Literal empty strings are treated as missing values when loaded as values by
745 * default. Pass `{ preserveEmptyStrings: true }` to keep empty strings as
746 * explicit values.
747 *
748 * **Gotchas**
749 *
750 * Object keys and array lengths reflect the original input shape. A leaf value
751 * of `""` is treated as missing when that leaf is loaded, but the parent
752 * container still reports its original keys or length.
753 *
754 * **Example** (Providing config from a plain object)
755 *
756 * ```ts import.meta.vitest
757 * import { Config, ConfigProvider, Effect } from "effect"
758 *
759 * const provider = ConfigProvider.fromUnknown({

Callers 1

fromUnknownFunction · 0.85

Calls 1

describeUnknownFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…