{"id":18153451,"url":"https://github.com/thinknathan/tstl-simple-const-unroller","last_synced_at":"2025-03-31T16:30:28.624Z","repository":{"id":207489755,"uuid":"719375926","full_name":"thinknathan/tstl-simple-const-unroller","owner":"thinknathan","description":"TypeScriptToLua plugin that performs constant folding for simple numeric expressions","archived":false,"fork":false,"pushed_at":"2023-12-06T07:04:08.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-12-07T03:00:25.432Z","etag":null,"topics":["lua","tstl","tstl-extension","tstl-plugin","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thinknathan.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":"2023-11-16T03:01:18.000Z","updated_at":"2023-12-06T01:39:50.000Z","dependencies_parsed_at":"2023-11-16T04:24:15.546Z","dependency_job_id":"fb5f57f3-1e40-4753-9e39-4afb2e46f503","html_url":"https://github.com/thinknathan/tstl-simple-const-unroller","commit_stats":null,"previous_names":["thinknathan/tstl-simple-const-unroller"],"tags_count":2,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinknathan%2Ftstl-simple-const-unroller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinknathan%2Ftstl-simple-const-unroller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinknathan%2Ftstl-simple-const-unroller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thinknathan%2Ftstl-simple-const-unroller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thinknathan","download_url":"https://codeload.github.com/thinknathan/tstl-simple-const-unroller/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222666828,"owners_count":17019883,"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":["lua","tstl","tstl-extension","tstl-plugin","typescript"],"created_at":"2024-11-02T03:07:05.437Z","updated_at":"2024-11-02T03:07:05.997Z","avatar_url":"https://github.com/thinknathan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tstl-simple-const-unroller\n\nTypeScriptToLua plugin that performs [constant folding](https://en.wikipedia.org/wiki/Constant_folding) for simple numeric expressions:\n\n- Addition (+)\n- Subtraction (-)\n- Multiplication (\\*)\n- Division (/)\n- Modulo (%)\n- Exponentiation (\\*\\*)\n\nAll parts of the expression must be numeric literals.\n\nRedundancy warning: Your target Lua runtime may already perform constant folding.\n\n## Example\n\n```ts\nconst hour = 60 * 60;\n```\n\nBecomes:\n\n```lua\nlocal hour = 3600\n```\n\n## Installation\n\nRequires a modern version of TSTL. Tested on TSTL \u003e= 1.22.0.\n\n1. Install this plugin\n\n```bash\nyarn add git+https://git@github.com/thinknathan/tstl-simple-const-unroller.git#^1.0.0 -D\n# or\nnpm install git+https://git@github.com/thinknathan/tstl-simple-const-unroller.git#^1.0.0 --save-dev\n```\n\n2. Add `tstl-simple-const-unroller` to `tstl.luaPlugins` in `tsconfig.json`\n\n```diff\n{\n\t\"tstl\": {\n\t\t\"luaPlugins\": [\n+\t\t\t{ \"name\": \"tstl-simple-const-unroller\" }\n\t\t],\n\t}\n}\n```\n\n## License\n\nCC0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthinknathan%2Ftstl-simple-const-unroller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthinknathan%2Ftstl-simple-const-unroller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthinknathan%2Ftstl-simple-const-unroller/lists"}