{"id":27313352,"url":"https://github.com/itsabdelrahman/functional-conditional","last_synced_at":"2025-04-12T06:54:35.240Z","repository":{"id":57243027,"uuid":"172215778","full_name":"itsabdelrahman/functional-conditional","owner":"itsabdelrahman","description":"🐏 Conditional Logic: The Functional Way","archived":false,"fork":false,"pushed_at":"2019-03-03T02:38:14.000Z","size":65,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-12T06:54:30.848Z","etag":null,"topics":["case","else","if","switch","then","when"],"latest_commit_sha":null,"homepage":"","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/itsabdelrahman.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":"2019-02-23T13:09:42.000Z","updated_at":"2019-11-13T18:52:06.000Z","dependencies_parsed_at":"2022-09-15T00:50:46.879Z","dependency_job_id":null,"html_url":"https://github.com/itsabdelrahman/functional-conditional","commit_stats":null,"previous_names":["ar-maged/functional-conditional"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsabdelrahman%2Ffunctional-conditional","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsabdelrahman%2Ffunctional-conditional/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsabdelrahman%2Ffunctional-conditional/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsabdelrahman%2Ffunctional-conditional/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itsabdelrahman","download_url":"https://codeload.github.com/itsabdelrahman/functional-conditional/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248530585,"owners_count":21119595,"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":["case","else","if","switch","then","when"],"created_at":"2025-04-12T06:54:34.531Z","updated_at":"2025-04-12T06:54:35.233Z","avatar_url":"https://github.com/itsabdelrahman.png","language":"TypeScript","readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003efunctional-conditional\u003c/h1\u003e\n\n  \u003cb\u003eConditional Logic: The Functional Way\u003c/b\u003e\n\u003c/div\u003e\n\n## Usage\n\nTurn this:\n\n```ts\nlet result = null;\n\nswitch (someValue) {\n  case 0:\n    result = 'zero';\n    break;\n  case 1:\n    result = 'one';\n    break;\n  case 2:\n    result = 'two';\n    break;\n}\n```\n\nInto this:\n\n```ts\nimport conditional from 'functional-conditional';\n\nconst result = conditional\u003cnumber, string\u003e([\n  { if: 0, then: 'zero' },\n  { if: 1, then: 'one' },\n  { if: 2, then: 'two' },\n])(someValue);\n```\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsabdelrahman%2Ffunctional-conditional","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitsabdelrahman%2Ffunctional-conditional","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsabdelrahman%2Ffunctional-conditional/lists"}