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

x/ayonli_jsext/esm/object/index.js>flatKeys

A JavaScript extension package for building strong and modern applications.
Latest
function flatKeys
import { flatKeys } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/object/index.js";

Create an object with flatted keys of the original object, the children nodes' properties will be transformed to a string-represented path.

NOTE: This function only operates on plain objects and arrays.

Examples

Example 1

import { flatKeys } from "@ayonli/jsext/object";

const obj = flatKeys({ foo: { bar: "Hello", baz: "World" } });

console.log(obj); // { "foo.bar": "Hello", "foo.baz": "World" }

Parameters

obj

Default value: 1.

optional
depth = [UNSUPPORTED]
optional
options = [UNSUPPORTED]