{"id":16690596,"url":"https://github.com/jonkemp/flat-util","last_synced_at":"2025-04-10T00:51:11.824Z","repository":{"id":43045218,"uuid":"235494079","full_name":"jonkemp/flat-util","owner":"jonkemp","description":"Small utility to flatten a nested array","archived":false,"fork":false,"pushed_at":"2025-02-01T16:43:36.000Z","size":319,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T00:51:06.472Z","etag":null,"topics":["array","flat","flatten","nested","util","utility"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonkemp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-22T03:53:09.000Z","updated_at":"2025-02-01T16:43:39.000Z","dependencies_parsed_at":"2022-09-10T13:41:29.501Z","dependency_job_id":null,"html_url":"https://github.com/jonkemp/flat-util","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonkemp%2Fflat-util","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonkemp%2Fflat-util/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonkemp%2Fflat-util/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonkemp%2Fflat-util/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonkemp","download_url":"https://codeload.github.com/jonkemp/flat-util/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137997,"owners_count":21053775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["array","flat","flatten","nested","util","utility"],"created_at":"2024-10-12T16:04:25.416Z","updated_at":"2025-04-10T00:51:11.808Z","avatar_url":"https://github.com/jonkemp.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flat-util ![Build Status](https://github.com/jonkemp/flat-util/actions/workflows/main.yml/badge.svg?branch=master)\n\n\u003e Flatten a nested array.\n\nThe nesting can be to any depth. If you pass shallow, the array will only be flattened one level. \n\n## Features\n\n- Small utility to flatten nested arrays.\n- Free of TypeScript. 😄\n\n\n## Install\n\nInstall with [npm](https://npmjs.org/package/flat-util)\n\n```\n$ npm install flat-util\n```\n\nOr [unpkg](https://unpkg.com/flat-util/)\n\n```\n\u003cscript src=\"https://unpkg.com/flat-util@1.1.9/umd/index.js\" /\u003e\n```\n\nCheck out the unit tests on [CodePen](https://codepen.io/jonkemp/full/YzPBmwz).\n\n## Usage\n\n```js\nconst flatten = require('flat-util');\n\nflatten([1, 2, [3, 4]]);\n//=\u003e [1, 2, 3, 4]\n\nflatten([1, [2], [3, [[4]]]]);\n//=\u003e [1, 2, 3, 4];\n\nflatten([1, [2], [3, [[4]]]], true);\n//=\u003e [1, 2, 3, [[4]]];\n```\n\n---\n| **Like us a lot?** Help others know why you like us! **Review this package on [pkgreview.dev](https://pkgreview.dev/npm/flat-util)** | ➡   | [![Review us on pkgreview.dev](https://i.ibb.co/McjVMfb/pkgreview-dev.jpg)](https://pkgreview.dev/npm/flat-util) |\n| ----------------------------------------------------------------------------------------------------------------------------------------- | --- | --------------------------------------------------------------------------------------------------------------------- |\n\n## API\n\n### flatten(input, shallow)\n\n#### input\n\nType: `array`  \nDefault: `none`\n\nThe array to flatten.\n\n#### shallow\n\nType: `boolean`  \nDefault: `false`\n\nWhether or not to flatten the array only one level.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonkemp%2Fflat-util","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonkemp%2Fflat-util","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonkemp%2Fflat-util/lists"}