{"id":20838750,"url":"https://github.com/royalicing/swift-kick","last_synced_at":"2025-10-08T14:45:46.455Z","repository":{"id":65509461,"uuid":"55759693","full_name":"RoyalIcing/swift-kick","owner":"RoyalIcing","description":"Command line tool to ease Swift development","archived":false,"fork":false,"pushed_at":"2016-06-20T12:28:01.000Z","size":23,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-25T02:03:59.922Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/RoyalIcing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-08T07:34:36.000Z","updated_at":"2016-07-01T16:26:35.000Z","dependencies_parsed_at":"2023-01-26T16:55:12.344Z","dependency_job_id":null,"html_url":"https://github.com/RoyalIcing/swift-kick","commit_stats":null,"previous_names":["burntcaramel/swift-kick"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoyalIcing%2Fswift-kick","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoyalIcing%2Fswift-kick/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoyalIcing%2Fswift-kick/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RoyalIcing%2Fswift-kick/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RoyalIcing","download_url":"https://codeload.github.com/RoyalIcing/swift-kick/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243196649,"owners_count":20251860,"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":[],"created_at":"2024-11-18T01:11:26.913Z","updated_at":"2025-10-08T14:45:41.390Z","avatar_url":"https://github.com/RoyalIcing.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# swift-kick\nTool to ease Swift development.\n\n## [Use online here](https://www.burntcaramel.com/swift-kick/)\n\n## Command line tool instructions\n\n### Enum Equality\n\n1. Copy your Swift enum declaration with associated values.\n2. `pbpaste | swift-kick enum:eq | pbcopy`\n3. Paste.\n\n### Enum [JSON parsing and serialization](https://github.com/BurntCaramel/JSON)\n\n1. Copy your Swift enum declaration with associated values.\n2. `pbpaste | swift-kick enum:json | pbcopy`\n3. Paste.\n\n## Example\n\n```swift\n// Example enum:\n\npublic enum ContentReference {\n\tcase localSHA256(sha256: String, contentType: ContentType)\n\tcase remote(url: NSURL, contentType: ContentType)\n\tcase collected1(host: String, account: String, id: String, contentType: ContentType)\n}\n```\n\n```swift\n// pbpaste | swift-kick enum:eq | pbcopy\n\npublic func == (lhs: ContentReference, rhs: ContentReference) {\n\tswitch (lhs, rhs) {\n\tcase let (.localSHA256(l), .localSHA256(r)):\n\t\treturn l.sha256 == r.sha256 \u0026\u0026 l.contentType == r.contentType\n\tcase let (.remote(l), .remote(r)):\n\t\treturn l.url == r.url \u0026\u0026 l.contentType == r.contentType\n\tcase let (.collected1(l), .collected1(r)):\n\t\treturn l.host == r.host \u0026\u0026 l.account == r.account \u0026\u0026 l.id == r.id \u0026\u0026 l.contentType == r.contentType\n\t}\n}\n```\n\n```swift\n// pbpaste | swift-kick enum:json | pbcopy\n\nextension ContentReference {\n\tpublic enum Kind : String, KindType {\n\t\tcase localSHA256 = \"localSHA256\"\n\t\tcase remote = \"remote\"\n\t\tcase collected1 = \"collected1\"\n\t}\n\n\tpublic var kind: Kind {\n\t\tswitch self {\n\t\tcase .localSHA256: return .localSHA256\n\t\tcase .remote: return .remote\n\t\tcase .collected1: return .collected1\n\t\t}\n\t}\n}\n\nextension ContentReference : JSONObjectRepresentable {\n\tpublic init(source: JSONObjectDecoder) throws {\n\t\tlet type: Kind = try source.decode(\"type\")\n\t\tswitch type {\n\t\tcase .localSHA256:\n\t\t\tself = try .localSHA256(\n\t\t\t\tsha256: source.decode(\"sha256\"),\n\t\t\t\tcontentType: source.decode(\"contentType\")\n\t\t\t)\n\t\tcase .remote:\n\t\t\tself = try .remote(\n\t\t\t\turl: source.decodeURL(\"url\"),\n\t\t\t\tcontentType: source.decode(\"contentType\")\n\t\t\t)\n\t\tcase .collected1:\n\t\t\tself = try .collected1(\n\t\t\t\thost: source.decode(\"host\"),\n\t\t\t\taccount: source.decode(\"account\"),\n\t\t\t\tid: source.decode(\"id\"),\n\t\t\t\tcontentType: source.decode(\"contentType\")\n\t\t\t)\n\t\t}\n\t}\n\n\tpublic func toJSON() -\u003e JSON {\n\t\tswitch self {\n\t\tcase let .localSHA256(sha256, contentType):\n\t\t\treturn .ObjectValue([\n\t\t\t\t\"type\": Kind.localSHA256.toJSON(),\n\t\t\t\t\"sha256\": sha256.toJSON(),\n\t\t\t\t\"contentType\": contentType.toJSON()\n\t\t\t])\n\t\tcase let .remote(url, contentType):\n\t\t\treturn .ObjectValue([\n\t\t\t\t\"type\": Kind.remote.toJSON(),\n\t\t\t\t\"url\": url.toJSON(),\n\t\t\t\t\"contentType\": contentType.toJSON()\n\t\t\t])\n\t\tcase let .collected1(host, account, id, contentType):\n\t\t\treturn .ObjectValue([\n\t\t\t\t\"type\": Kind.collected1.toJSON(),\n\t\t\t\t\"host\": host.toJSON(),\n\t\t\t\t\"account\": account.toJSON(),\n\t\t\t\t\"id\": id.toJSON(),\n\t\t\t\t\"contentType\": contentType.toJSON()\n\t\t\t])\n\t\t}\n\t}\n}\n```\n\n## Installation\n\nRequires [node.js](https://nodejs.org/en/download/package-manager/)\n\n```\nnpm install -g swift-kick\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froyalicing%2Fswift-kick","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froyalicing%2Fswift-kick","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froyalicing%2Fswift-kick/lists"}