{"id":23143086,"url":"https://github.com/cleancocoa/pathutils","last_synced_at":"2026-02-02T11:47:01.050Z","repository":{"id":87401470,"uuid":"521922120","full_name":"CleanCocoa/PathUtils","owner":"CleanCocoa","description":"μ-library to deal with non-empty strings, filenames, and directories.","archived":false,"fork":false,"pushed_at":"2024-11-23T14:20:28.000Z","size":76,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-05T08:35:10.091Z","etag":null,"topics":[],"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/CleanCocoa.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-06T11:00:55.000Z","updated_at":"2024-11-23T14:19:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"aafc7055-56d4-42ec-bad4-431a3b4c1209","html_url":"https://github.com/CleanCocoa/PathUtils","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/CleanCocoa/PathUtils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanCocoa%2FPathUtils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanCocoa%2FPathUtils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanCocoa%2FPathUtils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanCocoa%2FPathUtils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CleanCocoa","download_url":"https://codeload.github.com/CleanCocoa/PathUtils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CleanCocoa%2FPathUtils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270859304,"owners_count":24658181,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"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":[],"created_at":"2024-12-17T15:12:07.666Z","updated_at":"2026-02-02T11:46:56.009Z","avatar_url":"https://github.com/CleanCocoa.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PathUtils\n\nμ-library to deal with non-empty strings, filenames, and directories.\n\n## Usage\n\nThe base types protect important invariants and are as follows:\n\n- `ContentfulString` cannot be constructed from an empty string.\n- `Filename`, e.g. just \"foo\". The filename is never an empty string.\n- `Basename`, e.g. \"foo.txt\". The path extension is optional, but a valid filename is always present.\n- `Folder` keeps a URL reference, but only to local directory URLs.\n- `FileURL` only accepts local `file:` URLs, but rejects directories.\n\n`FileURL` is the true star of the show: It combines `Folder` + `Basename` to represent local file URLs,\nso access to these never fails. Once you have a `FileURL`, you get checks for non-directory, local `file:` URLs\nfor free. There's always going to be a basename for convenient access.\n\nConstruct file URLs from components, e.g. to create a destination URL for a new file in an existing folder:\n\n```swift\nguard let basename = Basename(\"foo.txt\"),\n      let folder = Folder(url: URL(fileURLWithPath: \"/path/to/success/\"))\nelse { exit }\n\nlet fileURL: FileURL = basename.fileURL(relativeTo: folder)\n```\n\nFilter URLs from user input for local filesystem references:\n\n```swift\nlet url: URL = ...\n\nguard let fileURL = FileURL(from: url) else { exit }\n\nprint(\"You selected\", fileURL.basename, \"in\", fileURL.folder)\n```\n\nConstruct file URLs from existing primitives by concatenation through custom operators:\n\n```swift\n// Custom operators!\nlet path: String = folder + basename\nlet fileURL: FileURL = folder + basename\n```\n\n## Installation\n\n### Using Swift Package Manager\n\n```swift\n.package(url: \"https://github.com/CleanCocoa/PathUtils\", from: \"0.3.2\")\n```\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleancocoa%2Fpathutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcleancocoa%2Fpathutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleancocoa%2Fpathutils/lists"}