{"id":32320374,"url":"https://github.com/redwerk/validatekit","last_synced_at":"2025-10-23T11:54:47.335Z","repository":{"id":56925825,"uuid":"211055536","full_name":"redwerk/ValidateKit","owner":"redwerk","description":"The framework for validating data of models.","archived":false,"fork":false,"pushed_at":"2019-10-07T15:40:47.000Z","size":162,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-23T11:54:45.728Z","etag":null,"topics":["carthage","cocoapods","models","swift","swift-package-manager","validate","xcode"],"latest_commit_sha":null,"homepage":"https://redwerk.com/","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/redwerk.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":"2019-09-26T09:48:48.000Z","updated_at":"2019-10-07T15:24:15.000Z","dependencies_parsed_at":"2022-08-21T06:20:06.841Z","dependency_job_id":null,"html_url":"https://github.com/redwerk/ValidateKit","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/redwerk/ValidateKit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redwerk%2FValidateKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redwerk%2FValidateKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redwerk%2FValidateKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redwerk%2FValidateKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redwerk","download_url":"https://codeload.github.com/redwerk/ValidateKit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redwerk%2FValidateKit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280614538,"owners_count":26360841,"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-10-23T02:00:06.710Z","response_time":142,"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":["carthage","cocoapods","models","swift","swift-package-manager","validate","xcode"],"created_at":"2025-10-23T11:54:41.817Z","updated_at":"2025-10-23T11:54:47.331Z","avatar_url":"https://github.com/redwerk.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n   \u003cimg width=\"200\" src=\"https://raw.githubusercontent.com/SvenTiigi/SwiftKit/gh-pages/readMeAssets/SwiftKitLogo.png\" alt=\"ValidateKit Logo\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n   \u003ca href=\"https://developer.apple.com/swift/\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/Swift-4.2-orange.svg?style=flat\" alt=\"Swift 4.2\"\u003e\n   \u003c/a\u003e\n   \u003ca href=\"http://cocoapods.org/pods/ValidateKit\"\u003e\n      \u003cimg src=\"https://img.shields.io/cocoapods/v/ValidateKit.svg?style=flat\" alt=\"Version\"\u003e\n   \u003c/a\u003e\n   \u003ca href=\"http://cocoapods.org/pods/ValidateKit\"\u003e\n      \u003cimg src=\"https://img.shields.io/cocoapods/p/ValidateKit.svg?style=flat\" alt=\"Platform\"\u003e\n   \u003c/a\u003e\n   \u003ca href=\"https://github.com/Carthage/Carthage\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat\" alt=\"Carthage Compatible\"\u003e\n   \u003c/a\u003e\n   \u003ca href=\"https://github.com/apple/swift-package-manager\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg\" alt=\"SPM\"\u003e\n   \u003c/a\u003e\n\u003c/p\u003e\n\n# ValidateKit\n\n\u003cp align=\"center\"\u003e\nValidateKit is a framework for validating data of model.\n\u003c/p\u003e\n\n## Features\n- [x] Validation rules:\n  - [x] Custom rule/throw/value\n  - [x] Range (n...m, n..., ...m)\n  - [x] Count (n...m, n..., ...m, min, max, empty)\n  - [x] Nil\n  - [x] CharacterSet (alphanumerics, numerics, phone, custom set)\n  - [x] Email\n  - [ ] URL\n  - [ ] Payment card\n  - [ ] Contains\n- [x] Operations with rules\n  - [x] and `\u0026\u0026`\n  - [x] or `||`\n  - [x] not `!`\n- [x] An open protocol-oriented implementation\n- [x] Comprehensive test coverage\n- [ ] Code documentation\n\n## Requirements\n\n`iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+`\n\n`Xcode 10.0+`\n\n`Swift 4.2+`\n\n## Example\n\nThe example application is the best way to see `ValidateKit` in action. Simply open the `ValidateKit.xcodeproj` and run the `Example` scheme.\n\n## Installation\n\n### CocoaPods\n\nValidateKit is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```bash\npod 'ValidateKit'\n```\nor\n```bash\npod 'ValidateKit', :git =\u003e 'https://github.com/redwerk/ValidateKit.git', :branch =\u003e 'master'\n```\n\n### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nTo integrate ValidateKit into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```bash\ngithub 'redwerk/ValidateKit'\n```\n\nRun `carthage update` to build the framework and drag the built `ValidateKit.framework` into your Xcode project. \n\nOn your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase” and add the Framework path as mentioned in [Carthage Getting started Step 4, 5 and 6](https://github.com/Carthage/Carthage/blob/master/README.md#if-youre-building-for-ios-tvos-or-watchos)\n\n### Swift Package Manager\n\nTo integrate using Apple's [Swift Package Manager](https://swift.org/package-manager/), add the following as a dependency to your `Package.swift`:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/redwerk/ValidateKit.git\", from: \"1.0.0\")\n]\n```\n\n### Manually\n\nIf you prefer not to use any of the aforementioned dependency managers, you can integrate ValidateKit into your project manually. Simply drag the `Sources` Folder into your Xcode project.\n\n## Usage\n\n```swift\nimport Foundation\nimport ValidateKit\n\nstruct User {\n  var id: Int\n  var name: String\n  var email: String?\n  var age: Int\n  var about: String\n  var hobbies: [String] = [\"a\", \"b\", \"c\"]\n  var phone: String\n}\n\nextension User: Validatable {\n\n  private static var nameCharacterSet: CharacterSet {\n    var characterSet = CharacterSet()\n    characterSet.formUnion(.lowercaseLetters)\n    characterSet.formUnion(.uppercaseLetters)\n    return characterSet\n  }\n\n  static func conditions() throws -\u003e Conditions\u003cUser\u003e {\n    var conditions = Conditions(User.self)\n    conditions.add(\\.id, \"id\", .range(0...100) || .range(10000...))\n    conditions.add(\\.email, \"email\", .email \u0026\u0026 !.nil)\n    conditions.add(\\.age, \"age\", .range(1...))\n    conditions.add(\\.name, \"name\", .count(3...20) \u0026\u0026 .characters(nameCharacterSet))\n    conditions.add(\\.about, \"description length\", .count(30...))\n    conditions.add(\\.hobbies, \"hobbies\", !.empty)\n    conditions.add(\\.phone, \"phone\", .phoneCharacters)\n    return conditions\n  }\n  \n}\n\n// ...\n\nlet user = User(...)\n\ndo {\n    try user.validate()\n} catch let error {\n    print(error.localizedDescription)\n}\n```\n\n## Contributing\nContributions are very welcome 🙌\n\n## License\n\n```\nValidateKit\nCopyright (c) 2019 Redwerk info@redwerk.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredwerk%2Fvalidatekit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredwerk%2Fvalidatekit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredwerk%2Fvalidatekit/lists"}