Toolbox-XToolbox-X

Flatten Object Dot Notation

Converts a nested object structure into a flat object using dot notation for keys.

flattenObjectDotNotation

The flattenObjectDotNotation function converts a nested object structure into a flat, single-level object using dot-separated paths for keys.

Function Signature

function flattenObjectDotNotation<T extends GenericObject>(
  object: T
): FlattenDotValue<MergeAll<[T]>>

Parameters

  • object (T): The nested object to flatten.

Return Value

  • FlattenDotValue<MergeAll<[T]>>: A flat object with dot-notation keys mapped to their original nested values.

Example Usage

playground.ts

Notes

  • Arrays: Arrays are treated as terminal/primitive values and are not flattened.
  • Special Objects: Instances of Date, RegExp, etc. are preserved as-is.
  • Returns a new object without mutating the original object.

Last updated: Sun, Jun 14, 2026 07:06:16AM (UTC)

On this page