{"id":24663597,"url":"https://github.com/korkje/match","last_synced_at":"2026-05-09T01:32:15.534Z","repository":{"id":57125472,"uuid":"190566392","full_name":"korkje/match","owner":"korkje","description":"Alternative to the switch statement","archived":false,"fork":false,"pushed_at":"2024-06-09T22:51:47.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-05T09:48:54.683Z","etag":null,"topics":["deno","switch","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/korkje.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","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-06-06T10:59:04.000Z","updated_at":"2024-06-09T22:51:19.000Z","dependencies_parsed_at":"2024-06-09T22:48:56.784Z","dependency_job_id":"b85fa730-33f0-4032-8a68-3c4802151758","html_url":"https://github.com/korkje/match","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/korkje%2Fmatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/korkje%2Fmatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/korkje%2Fmatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/korkje%2Fmatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/korkje","download_url":"https://codeload.github.com/korkje/match/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244153354,"owners_count":20406997,"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":["deno","switch","typescript"],"created_at":"2025-01-26T05:15:24.235Z","updated_at":"2026-05-09T01:32:10.516Z","avatar_url":"https://github.com/korkje.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# match [![JSR](https://jsr.io/badges/@korkje/match)](https://jsr.io/@korkje/match)\n\nAlternative to the `switch` statement in JS/TS.\n\n```ts\nimport match from \"@korkje/match\";\n\nconst inRange = (lo: number, hi: number) =\u003e (n: number) =\u003e n \u003e= lo \u0026\u0026 n \u003c hi;\n\nconst result = match(Math.random())\n    .on(inRange(0, 0.5), \"[0, 0.5)\")\n    .on(inRange(0.5, 1), \"[0.5, 1)\")\n    .default(\"Throw away your computer\")\n    .result();\n\nconsole.log(result); \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkorkje%2Fmatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkorkje%2Fmatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkorkje%2Fmatch/lists"}