{"id":16048922,"url":"https://github.com/devongovett/babel-plugin-multidimensional-array","last_synced_at":"2025-04-05T07:14:43.125Z","repository":{"id":66053669,"uuid":"62870315","full_name":"devongovett/babel-plugin-multidimensional-array","owner":"devongovett","description":"Fast multidimensional typed arrays with a nice syntax","archived":false,"fork":false,"pushed_at":"2016-07-08T08:17:09.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-02T09:24:08.072Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/devongovett.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":"2016-07-08T08:03:17.000Z","updated_at":"2019-07-31T21:34:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"6b6dfcd5-7e50-437f-9a9b-4ebce151bbdf","html_url":"https://github.com/devongovett/babel-plugin-multidimensional-array","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"d9e8cd3165659bbaed9695a160f93a2170bc678e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devongovett%2Fbabel-plugin-multidimensional-array","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devongovett%2Fbabel-plugin-multidimensional-array/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devongovett%2Fbabel-plugin-multidimensional-array/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devongovett%2Fbabel-plugin-multidimensional-array/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devongovett","download_url":"https://codeload.github.com/devongovett/babel-plugin-multidimensional-array/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247299850,"owners_count":20916193,"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-09T00:11:15.712Z","updated_at":"2025-04-05T07:14:43.105Z","avatar_url":"https://github.com/devongovett.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# babel-plugin-multidimensional-array\n\nFast multidimensional typed arrays with a nice syntax.\n\nTyped arrays are awesome, but sometimes you want a multidimensional array.\nYou can do it with arrays of (arrays of...) typed arrays, but accessing\nor writing data to nested array objects is slow.\n\nOne way to fix this is by using a single flattened typed array, and hand\ncalculating the offset where the data is for every access. But that is tedious.\nThis babel plugin takes care of it for you. Just define your local variables or\nfunction arguments with dimensions, and accesses will be transformed to compute\nthe correct offset.\n\n## Example\n\nCompiles this:\n\n```javascript\nlet x[2][3] = new Uint8Array([1,2,3,4,5,6]);\nx[1][2] = 42;\n```\n\ninto:\n\n```javascript\nlet x = new Uint8Array([1,2,3,4,5,6]);\nx[5] = 42;\n```\n\nFunction arguments are also supported, as are non-constant dimensions:\n\n```javascript\nfunction test(x[a][b], y) {\n  x[1][y] = 4;\n}\n```\n\ncompiles to:\n\n```javascript\nfunction test(x, y) {\n  x[y + b * 1] = 4;\n}\n```\n\nSubarrays are also supported, if you access only one of the dimensions:\n\n```javascript\nlet y[2][3][4] = new Uint8Array(2 * 3 * 4);\nconsole.log(y[1]);\n```\n\ncompiles to:\n\n```javascript\nlet y = new Uint8Array(2 * 3 * 4);\nconsole.log(y.subarray(12, 24));\n```\n\n## Licence\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevongovett%2Fbabel-plugin-multidimensional-array","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevongovett%2Fbabel-plugin-multidimensional-array","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevongovett%2Fbabel-plugin-multidimensional-array/lists"}