{"id":19041962,"url":"https://github.com/writetome51/array-get-and-remove-by-test","last_synced_at":"2026-04-18T09:31:32.574Z","repository":{"id":122062333,"uuid":"154913225","full_name":"writetome51/array-get-and-remove-by-test","owner":"writetome51","description":"Receives a test function and both removes and returns array items that pass test","archived":false,"fork":false,"pushed_at":"2021-11-15T06:51:47.000Z","size":54,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-14T07:44:59.101Z","etag":null,"topics":["array-manipulations","filter","javascript","typescript"],"latest_commit_sha":null,"homepage":"","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/writetome51.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,"governance":null}},"created_at":"2018-10-27T01:51:23.000Z","updated_at":"2021-11-15T06:51:49.000Z","dependencies_parsed_at":"2023-07-22T18:00:14.867Z","dependency_job_id":null,"html_url":"https://github.com/writetome51/array-get-and-remove-by-test","commit_stats":null,"previous_names":["writetome51/array-get-and-remove-filtered-results"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/writetome51/array-get-and-remove-by-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-get-and-remove-by-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-get-and-remove-by-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-get-and-remove-by-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-get-and-remove-by-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/writetome51","download_url":"https://codeload.github.com/writetome51/array-get-and-remove-by-test/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-get-and-remove-by-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31963966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-manipulations","filter","javascript","typescript"],"created_at":"2024-11-08T22:33:32.393Z","updated_at":"2026-04-18T09:31:32.557Z","avatar_url":"https://github.com/writetome51.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# getAndRemoveByTest\\\u003cT, X\\\u003e(\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;test: (\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;value: T, index?: number, array?: T[]\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;) =\u003e boolean,\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;array: T[],\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;getValue?: (\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;value: T, index?: number, array?: T[]\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;) =\u003e X\u003cbr\u003e): X[]\n\nRemoves and returns items in `array` that pass `test`.  \nIncludes optional callback `getValue()`, which lets you customize what value to get from an element \nthat passes `test`.\n\n\n## Examples\n```js\nlet arr = ['hello', '??', 2, 'h', 1, 5, 'h', 'mertyujkl;', 20];\ngetAndRemoveByTest((item) =\u003e (item[0] === 'h'), arr);\n// --\u003e ['hello', 'h', 'h']\n// arr is now ['??', 2, 1, 5, 'mertyujkl;', 20];\n\n\narr = [true, 10, false, 2, 'h', 1, true];\ngetAndRemoveByTest(\n    (item) =\u003e typeof item === 'boolean',\n    arr,\n    (value, index) =\u003e ( {value, index} )\n);\n/**********\nReturns:\n[\n  { value: true, index: 0 },\n  { value: false, index: 2 },\n  { value: true, index: 6 }\n]\n\narr is now  [10, 2, 'h', 1];\n**********/\n```\n\n\n## Installation\n```bash\nnpm i @writetome51/array-get-and-remove-by-test\n```\n\n## Loading\n```js\nimport {getAndRemoveByTest} from '@writetome51/array-get-and-remove-by-test';\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwritetome51%2Farray-get-and-remove-by-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwritetome51%2Farray-get-and-remove-by-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwritetome51%2Farray-get-and-remove-by-test/lists"}