{"id":19042138,"url":"https://github.com/writetome51/array-editor","last_synced_at":"2025-10-28T00:36:29.791Z","repository":{"id":122062327,"uuid":"149851328","full_name":"writetome51/array-editor","owner":"writetome51","description":"The most bad-ass array manipulation tool on the planet!","archived":false,"fork":false,"pushed_at":"2018-12-11T05:40:52.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-02T07:26:26.240Z","etag":null,"topics":["array-manipulations","array-methods","swissarmyknife","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.txt","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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-22T06:19:40.000Z","updated_at":"2018-12-11T05:40:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"8bf2daf0-1e26-4257-bd1b-a1ca9530985f","html_url":"https://github.com/writetome51/array-editor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-editor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-editor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-editor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-editor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/writetome51","download_url":"https://codeload.github.com/writetome51/array-editor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240100512,"owners_count":19747683,"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-manipulations","array-methods","swissarmyknife","typescript"],"created_at":"2024-11-08T22:35:21.660Z","updated_at":"2025-10-28T00:36:29.704Z","avatar_url":"https://github.com/writetome51.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Behold... ArrayEditor.\n\nArrayEditor bears many similarities to PublicArray (see the npm package @writetome51/public-array \nand repository github.com/writetome51/PublicArray).  All its method names are nearly identical.\nBut there's a couple of crucial differences.  Most of ArrayEditor's methods return the class instance, \nmaking the methods chainable.  So you can write statements like this:\n\neditor.remove_allOf('nuts').insert_multiple(['jelly','donut'], 2).append_single('frosting').export();\n\nArrayEditor has only 4 public properties, 'content', 'get', 'getConverted', and 'getAndRemove', which \nhave methods/properties identical to those of the classes PublicArrayContent, PublicArrayGetter, \nPublicArrayGetterConverter, and PublicArrayGetterRemover, respectively.  For example:\n\nlet length = editor.content.length // returns array length\nlet firstFiveItems = editor.get.head(5);\nlet sum = editor.getConverted.toOne(getSum);\nlet innerFourItems = editor.getAndRemove.adjacent(startingPosition, 4);\n\nAside from those 4 properties, ArrayEditor has chainable methods, and all of them match the \nmethods of PublicArray (well, almost match).  These examples illustrate the differences:  \nWhere PublicArray has the method  PublicArray.filter.byType() ,  ArrayEditor has the method \nArrayEditor.filter_byType() .  Where PublicArray has the method PublicArray.append.many() , \nArrayEditor has the method ArrayEditor.append_many() .  Where PublicArray has the method \nPublicArray.insert.one() , ArrayEditor has the method ArrayEditor.insert_one() .  Hopefully you \nsee the pattern.  In PublicArray, the method actually belongs to a property of PublicArray.  In \nArrayEditor, the dot that comes after the PublicArray property is replaced with an underscore.\nThat's where the differences end.  The signature of the ArrayEditor method matches its \ncorresponding PublicArray method.\n\nOne more thing:  ArrayEditor's methods are defined during runtime using a tool called MethodGenerator.  \nSo when you're calling these methods, a linting tool like TSLint will tell you these methods don't exist.  \nBecause, well, they technically don't until runtime.  In these cases, ignore TSLint.  Everything will be fine.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwritetome51%2Farray-editor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwritetome51%2Farray-editor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwritetome51%2Farray-editor/lists"}