{"id":15514474,"url":"https://github.com/petems/remove-singleton-arrays","last_synced_at":"2025-06-15T02:03:53.203Z","repository":{"id":137299789,"uuid":"176496348","full_name":"petems/remove-singleton-arrays","owner":"petems","description":"A Golang library to remove singleton arrays","archived":false,"fork":false,"pushed_at":"2019-03-22T15:56:11.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-15T02:03:09.925Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/petems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-19T11:23:22.000Z","updated_at":"2019-03-22T15:51:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"f52d7d61-220a-496f-a17a-c7d2d9ddf00b","html_url":"https://github.com/petems/remove-singleton-arrays","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/petems/remove-singleton-arrays","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petems%2Fremove-singleton-arrays","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petems%2Fremove-singleton-arrays/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petems%2Fremove-singleton-arrays/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petems%2Fremove-singleton-arrays/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/petems","download_url":"https://codeload.github.com/petems/remove-singleton-arrays/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petems%2Fremove-singleton-arrays/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259910673,"owners_count":22930702,"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":[],"created_at":"2024-10-02T09:59:28.086Z","updated_at":"2025-06-15T02:03:53.163Z","avatar_url":"https://github.com/petems.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# remove-singleton-arrays\n\n[![Build Status](https://travis-ci.org/petems/remove-singleton-arrays.svg?branch=master)](https://travis-ci.org/petems/remove-singleton-arrays)\n\nThis is a golang package to remove arrays that only have one element from a JSON object.\n\nArrays with more than one element are ignored.\n\n## Usage\n\nTo remove all singleton arrays:\n\n```go\nimport (\n\t. \"github.com/petems/remove-singleton-arrays\"\n)\n\nRemoveSingletonArrays(`{\"a\":1,\"b\":[\"2\"]}`)  // returns `{\"a\":1,\"b\":\"2\"}`\nRemoveSingletonArrays(`{\"a\":1,\"b\":[\"2, 3\"]}`) // returns `{\"a\":1,\"b\":[\"2\",\"3\"]}`\n```\n\nTo remove singleton arrays with selected exceptions:\n\n```go \nimport (\n\t\"github.com/petems/remove-singleton-arrays\"\n)\n\nremovesingletonarrays.WithIgnores(`{\"a\":1,\"b\":[\"2\"]}`, []string{\"b\"})  // returns `{\"a\":1,\"b\":[\"2\"]}`\nremovesingletonarrays.WithIgnores(`{\"a\":1,\"b\":[\"2\"]}`, []string{\"a\"})  // returns `{\"a\":1,\"b\":\"2\"}`\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetems%2Fremove-singleton-arrays","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpetems%2Fremove-singleton-arrays","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetems%2Fremove-singleton-arrays/lists"}