{"id":19031134,"url":"https://github.com/alexito4/casepaths-extensions","last_synced_at":"2026-06-18T12:32:27.497Z","repository":{"id":56209286,"uuid":"239713594","full_name":"alexito4/CasePaths-Extensions","owner":"alexito4","description":"Some simple CasePaths extensions","archived":false,"fork":false,"pushed_at":"2020-11-20T11:13:39.000Z","size":6,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-03T04:36:01.701Z","etag":null,"topics":["keypath","package","swift"],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/alexito4.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}},"created_at":"2020-02-11T08:37:02.000Z","updated_at":"2020-11-20T11:13:41.000Z","dependencies_parsed_at":"2022-08-15T14:40:55.675Z","dependency_job_id":null,"html_url":"https://github.com/alexito4/CasePaths-Extensions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alexito4/CasePaths-Extensions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexito4%2FCasePaths-Extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexito4%2FCasePaths-Extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexito4%2FCasePaths-Extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexito4%2FCasePaths-Extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexito4","download_url":"https://codeload.github.com/alexito4/CasePaths-Extensions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexito4%2FCasePaths-Extensions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34491228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["keypath","package","swift"],"created_at":"2024-11-08T21:21:37.327Z","updated_at":"2026-06-18T12:32:27.467Z","avatar_url":"https://github.com/alexito4.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CasePaths-Extensions\n\nSome simple [CasePaths](https://github.com/pointfreeco/swift-case-paths) extensions.\n\n# matches\n\nUseful to use in `if` conditions:\n\n```swift\nlet state = Authentication.authenticated(accessToken: \"123\")\n\nif (/Authentication.unauthenticated).matches(state) {\n    print(\"unauthenticated\")\n} else {\n    print(\"you're in!\")\n}\n```\n\n# map\n\nAs with `Optional.map` it transforms a value only if the enum is of the expected case.\n\n```swift\nlet userIn = Authentication.authenticated(accessToken: \"123\")\nlet userOut = Authentication.unauthenticated\n\n(/Authentication.authenticated).map(userIn, { $0.count }) // 3\n((/Authentication.authenticated).map(userOut, { $0.count }) // nil\n```\n\n# mutate\n\nSimilar to `map` but instead of returning any new type, it returns a new enum with a transformed value, only if the enum case matches.\n\n```swift\n(/Authentication.authenticated).mutate(userIn, { \"\u003e\u003e\\($0)\u003c\u003c\" })\n// returns Authentication.authenticated(accessToken: \"\u003e\u003e123\u003c\u003c\")\n\n```\n\n# Author\n\nAlejandro Martinez | http://alejandromp.com | [@alexito4](https://twitter.com/alexito4)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexito4%2Fcasepaths-extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexito4%2Fcasepaths-extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexito4%2Fcasepaths-extensions/lists"}