{"id":22962903,"url":"https://github.com/0xlet/dataobject","last_synced_at":"2025-09-10T03:37:48.849Z","repository":{"id":51402166,"uuid":"347732524","full_name":"0xLet/DataObject","owner":"0xLet","description":"📦  DataObject(Any)","archived":false,"fork":false,"pushed_at":"2021-05-12T01:51:26.000Z","size":21,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T05:20:14.272Z","etag":null,"topics":["any","dataobject","json","object","surl","swift","wtv"],"latest_commit_sha":null,"homepage":"","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/0xLet.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":"2021-03-14T19:23:56.000Z","updated_at":"2022-05-18T22:55:39.000Z","dependencies_parsed_at":"2022-09-04T00:52:18.656Z","dependency_job_id":null,"html_url":"https://github.com/0xLet/DataObject","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xLet%2FDataObject","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xLet%2FDataObject/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xLet%2FDataObject/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xLet%2FDataObject/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xLet","download_url":"https://codeload.github.com/0xLet/DataObject/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246750086,"owners_count":20827650,"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":["any","dataobject","json","object","surl","swift","wtv"],"created_at":"2024-12-14T19:18:38.230Z","updated_at":"2025-04-02T03:29:37.827Z","avatar_url":"https://github.com/0xLet.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DataObject\n\n*DataObject(Any)*\n\n## Basic Example\n```swift\nlet obj = DataObject(\"init_value\")\n    .set(variable: \"SomeValue\", value: \"qwerty\")\n    .set(variable: \"nil\", value: nil)\n\nXCTAssertEqual(obj.value(), \"init_value\")\nXCTAssertEqual(obj.SomeValue.value(), \"qwerty\")\nXCTAssertEqual(obj.nil, DataObject())\n```\n\n## [SURL](https://github.com/0xLeif/SURL) JSON Example\n```swift\n\"https://jsonplaceholder.typicode.com/users/7\".url?\n    .get { (obj) in\n        print(obj.variables.keys) // [AnyHashable(\"response\"), AnyHashable(\"data\")]\n        print(obj.data)\n}\n```\n\n\u003cdetails\u003e \n  \u003csummary\u003eJSON\u003c/summary\u003e \n\n```json \n{\n  \"id\": 7,\n  \"name\": \"Kurtis Weissnat\",\n  \"username\": \"Elwyn.Skiles\",\n  \"email\": \"Telly.Hoeger@billy.biz\",\n  \"address\": {\n    \"street\": \"Rex Trail\",\n    \"suite\": \"Suite 280\",\n    \"city\": \"Howemouth\",\n    \"zipcode\": \"58804-1099\",\n    \"geo\": {\n      \"lat\": \"24.8918\",\n      \"lng\": \"21.8984\"\n    }\n  },\n  \"phone\": \"210.067.6132\",\n  \"website\": \"elvis.io\",\n  \"company\": {\n    \"name\": \"Johns Group\",\n    \"catchPhrase\": \"Configurable multimedia task-force\",\n    \"bs\": \"generate enterprise e-tailers\"\n  }\n}\n```\n\n\u003c/details\u003e \n\n### Output: obj.data \n```swift\nDataObject {\n|    Variables\n|    * id: 7 (__NSCFNumber)\n|    * value: 500 bytes (Data)\n|    * address: {\n    city = Howemouth;\n    geo =     {\n        lat = \"24.8918\";\n        lng = \"21.8984\";\n    };\n    street = \"Rex Trail\";\n    suite = \"Suite 280\";\n    zipcode = \"58804-1099\";\n} (__NSDictionaryI)\n|    * email: Telly.Hoeger@billy.biz (__NSCFString)\n|    * json: {\n  \"id\": 7,\n  \"name\": \"Kurtis Weissnat\",\n  \"username\": \"Elwyn.Skiles\",\n  \"email\": \"Telly.Hoeger@billy.biz\",\n  \"address\": {\n    \"street\": \"Rex Trail\",\n    \"suite\": \"Suite 280\",\n    \"city\": \"Howemouth\",\n    \"zipcode\": \"58804-1099\",\n    \"geo\": {\n      \"lat\": \"24.8918\",\n      \"lng\": \"21.8984\"\n    }\n  },\n  \"phone\": \"210.067.6132\",\n  \"website\": \"elvis.io\",\n  \"company\": {\n    \"name\": \"Johns Group\",\n    \"catchPhrase\": \"Configurable multimedia task-force\",\n    \"bs\": \"generate enterprise e-tailers\"\n  }\n} (String)\n|    * website: elvis.io (NSTaggedPointerString)\n|    * username: Elwyn.Skiles (__NSCFString)\n|    * company: {\n    bs = \"generate enterprise e-tailers\";\n    catchPhrase = \"Configurable multimedia task-force\";\n    name = \"Johns Group\";\n} (__NSDictionaryI)\n|    * phone: 210.067.6132 (__NSCFString)\n|    * name: Kurtis Weissnat (__NSCFString)\n}\n```\n\n## [WTV](https://github.com/0xLeif/WTV) Example\n```swift\n\"https://jsonplaceholder.typicode.com/users/7\".url?\n    .get { (obj) in\n        print(obj.data.wtv(named: \"name\")!)\n}\n```\n\n### Output: obj.data.wtv(named: \"name\")\n```swift\nDataObject.variables[\"company\"][\"name\"] 👉 FOUND: (label: Optional(\"name\"), value: Johns Group)\nDataObject.variables[\"name\"] 👉 FOUND: (label: Optional(\"name\"), value: Kurtis Weissnat)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xlet%2Fdataobject","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xlet%2Fdataobject","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xlet%2Fdataobject/lists"}