{"id":19375970,"url":"https://github.com/ftonato/plain-object","last_synced_at":"2025-02-24T15:42:29.490Z","repository":{"id":57325488,"uuid":"465462565","full_name":"ftonato/plain-object","owner":"ftonato","description":"Convert nested JSON to simple plain JSON object","archived":false,"fork":false,"pushed_at":"2022-03-04T14:30:58.000Z","size":61,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-07T06:36:26.130Z","etag":null,"topics":["destruct","destructure","flat","flatten","object","plain","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/plain-object","language":"TypeScript","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/ftonato.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["ftonato"]}},"created_at":"2022-03-02T20:40:58.000Z","updated_at":"2023-11-30T21:07:31.000Z","dependencies_parsed_at":"2022-09-09T08:52:06.217Z","dependency_job_id":null,"html_url":"https://github.com/ftonato/plain-object","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftonato%2Fplain-object","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftonato%2Fplain-object/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftonato%2Fplain-object/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftonato%2Fplain-object/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ftonato","download_url":"https://codeload.github.com/ftonato/plain-object/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240506939,"owners_count":19812696,"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":["destruct","destructure","flat","flatten","object","plain","typescript"],"created_at":"2024-11-10T08:40:55.015Z","updated_at":"2025-02-24T15:42:29.462Z","avatar_url":"https://github.com/ftonato.png","language":"TypeScript","readme":"# plain-object\n\n\u003e Convert nested JSON to simple plain JSON object\n\n## Install\n\n```sh\nnpm install plain-object\n```\n\n## Usage\n\n```js\nconst plainObject = require(\"plain-object\");\n\nplainObject({\n  one: {\n    one: \"1\",\n  },\n});\n//=\u003e { one: '1' }\n\nplainObject({\n  a: {\n    a: true,\n    b: {\n      b: new Map(),\n    },\n  },\n});\n//=\u003e { a: true, b: Map {  } }'\n\n// Given a \"weird\" structure like this:\n\nplainObject({\n  one: {\n    one: \"1\",\n    two: {\n      two: true,\n      three: {\n        three: 1,\n        four: {\n          four: [1, 2, 3],\n          five: {\n            five: new Date(),\n            six: {\n              six: function () {\n                return \"seven\";\n              },\n              seven: {\n                seven: new Map(),\n                eight: {\n                  eight: new Set(),\n                  nine: {\n                    nine: BigInt(Number.MAX_SAFE_INTEGER + 1),\n                    ten: {\n                      ten: Symbol(\"Sym\"),\n                      eleven: {\n                        eleven: Buffer.from(\"ftonato\", \"utf-8\"),\n                        twelve: {\n                          twelve: new RegExp(\"[A-Za-z0-9_]\"),\n                          thirteen: {\n                            thirteen: new Promise((resolve) =\u003e resolve(true)),\n                          },\n                        },\n                      },\n                    },\n                  },\n                },\n              },\n            },\n          },\n        },\n      },\n    },\n  },\n});\n\n// You will get this simple and clean object:\n\n//=\u003e { one: '1',\n//=\u003e   two: true,\n//=\u003e   three: 1,\n//=\u003e   four: [ 1, 2, 3 ],\n//=\u003e   five: Wed Mar 02 2022 20:04:04 GMT+0000 (Western European Standard Time),\n//=\u003e   six: [λ: six],\n//=\u003e   seven: Map {  },\n//=\u003e   eight: Set {  },\n//=\u003e   nine: 1,\n//=\u003e   ten: Symbol(Sym),\n//=\u003e   eleven: \u003cBuffer 66 74 6f 6e 61 74 6f\u003e,\n//=\u003e   twelve: /[A-Za-z0-9_]/,\n//=\u003e   thirteen: Promise { true } }\n```\n","funding_links":["https://github.com/sponsors/ftonato"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fftonato%2Fplain-object","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fftonato%2Fplain-object","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fftonato%2Fplain-object/lists"}