Have ideas to improve npm?Join in the discussion! »

object-flatten-all-arrays
TypeScript icon, indicating that this package has built-in type declarations

5.0.6 • Public • Published

object-flatten-all-arrays

Merge and flatten any arrays found in all values within plain objects

Install

npm i object-flatten-all-arrays

Quick Take

import { strict as assert } from "assert";
import { flattenAllArrays } from "object-flatten-all-arrays";

assert.deepEqual(
  flattenAllArrays({
    a: "a",
    b: "b",
    c: [
      {
        b: "b",
        a: "a",
      },
      {
        d: "d",
        c: "c",
      },
    ],
  }),
  {
    a: "a",
    b: "b",
    c: [
      {
        a: "a",
        b: "b",
        c: "c",
        d: "d",
      },
    ],
  }
);

Documentation

Please visit codsen.com for a full description of the API and examples.

Contributing

To report bugs or request features or assistance, raise an issue on GitHub.

Licence

MIT License

Copyright (c) 2010-2021 Roy Revelt and other contributors

ok codsen star

Install

npm i object-flatten-all-arrays

DownloadsWeekly Downloads

173

Version

5.0.6

License

MIT

Unpacked Size

150 kB

Total Files

12

Last publish

Collaborators

  • avatar