flat

  • Version 6.0.1
  • Published
  • 12 kB
  • No dependencies
  • BSD-3-Clause license

Install

npm i flat
yarn add flat
pnpm add flat

Overview

Take a nested Javascript object and flatten it, or unflatten an object with delimited keys

Index

Functions

function flatten

flatten: <T, R>(target: T, options?: FlattenOptions) => R;

    function unflatten

    unflatten: <T, R>(target: T, options?: UnflattenOptions) => R;

      Interfaces

      interface FlattenOptions

      interface FlattenOptions {}

        property delimiter

        delimiter?: string;

          property maxDepth

          maxDepth?: number;

            property safe

            safe?: boolean;

              property transformKey

              transformKey?: (key: string) => string;

                interface UnflattenOptions

                interface UnflattenOptions {}

                  property delimiter

                  delimiter?: string;

                    property object

                    object?: boolean;

                      property overwrite

                      overwrite?: boolean;

                        property transformKey

                        transformKey?: (key: string) => string;

                          Package Files (1)

                          Dependencies (0)

                          No dependencies.

                          Dev Dependencies (1)

                          Peer Dependencies (0)

                          No peer dependencies.

                          Badge

                          To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                          You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/flat.

                          • Markdown
                            [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/flat)
                          • HTML
                            <a href="https://www.jsdocs.io/package/flat"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>