{"id":26466725,"url":"https://github.com/didierfranc/sweetch","last_synced_at":"2026-04-12T14:36:40.839Z","repository":{"id":44118241,"uuid":"161311746","full_name":"didierfranc/sweetch","owner":"didierfranc","description":"Switch as a function","archived":false,"fork":false,"pushed_at":"2022-12-09T11:33:28.000Z","size":944,"stargazers_count":0,"open_issues_count":13,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-22T02:17:11.440Z","etag":null,"topics":["functional-programming","javascript","reactjs","switch","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/didierfranc.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}},"created_at":"2018-12-11T09:45:33.000Z","updated_at":"2020-07-17T12:33:25.000Z","dependencies_parsed_at":"2023-01-25T21:30:16.907Z","dependency_job_id":null,"html_url":"https://github.com/didierfranc/sweetch","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/didierfranc%2Fsweetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/didierfranc%2Fsweetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/didierfranc%2Fsweetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/didierfranc%2Fsweetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/didierfranc","download_url":"https://codeload.github.com/didierfranc/sweetch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244241490,"owners_count":20421687,"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":["functional-programming","javascript","reactjs","switch","typescript"],"created_at":"2025-03-19T12:37:23.835Z","updated_at":"2025-12-31T00:12:12.452Z","avatar_url":"https://github.com/didierfranc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sweetch 🎛\n\nSwitch as a function, you will be able to use it everywhere, mostly when native switch will produce syntax errors.\n\n```js\nimport sweetch from \"sweetch\";\n\nconst result = sweetch(\n  key,\n  [\"a\", 1],\n  [\"b\", 2],\n  [\"c\", 3],\n  [\"d\", 4],\n  [\"e\", 5],\n  \"default\"\n);\n\n// if key === \"a\" result will be 1\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdidierfranc%2Fsweetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdidierfranc%2Fsweetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdidierfranc%2Fsweetch/lists"}