import { flatKeys } from "https://deno.land/x/ayonli_jsext@v0.9.72/object/index.ts";
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
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: T
Default value: 1
.
Returns
OmitChildrenNodes<T> & Record<string | number | symbol, any>