{"id":19819831,"url":"https://github.com/capnslipp/nilcoalescingassignmentoperators","last_synced_at":"2026-02-05T10:02:50.993Z","repository":{"id":62449046,"uuid":"81877748","full_name":"capnslipp/NilCoalescingAssignmentOperators","owner":"capnslipp","description":"Combo Operators ??= and =?? (a Swift µ-Library)","archived":false,"fork":false,"pushed_at":"2024-11-16T20:39:37.000Z","size":54,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-18T21:41:09.172Z","etag":null,"topics":["null","operator","swift","swift-extensions","swift-library"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/capnslipp.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":"2017-02-13T22:16:30.000Z","updated_at":"2024-11-16T20:39:41.000Z","dependencies_parsed_at":"2025-01-11T08:24:31.599Z","dependency_job_id":"b57b22a8-9d92-4022-9e6e-734e2eb82f7d","html_url":"https://github.com/capnslipp/NilCoalescingAssignmentOperators","commit_stats":{"total_commits":41,"total_committers":2,"mean_commits":20.5,"dds":0.2195121951219512,"last_synced_commit":"a38507b9be94fb60d52bd06b9a2bd460d37b811b"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/capnslipp/NilCoalescingAssignmentOperators","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capnslipp%2FNilCoalescingAssignmentOperators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capnslipp%2FNilCoalescingAssignmentOperators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capnslipp%2FNilCoalescingAssignmentOperators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capnslipp%2FNilCoalescingAssignmentOperators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/capnslipp","download_url":"https://codeload.github.com/capnslipp/NilCoalescingAssignmentOperators/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capnslipp%2FNilCoalescingAssignmentOperators/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29119218,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T09:40:36.738Z","status":"ssl_error","status_checked_at":"2026-02-05T09:36:49.977Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["null","operator","swift","swift-extensions","swift-library"],"created_at":"2024-11-12T10:20:12.287Z","updated_at":"2026-02-05T10:02:50.946Z","avatar_url":"https://github.com/capnslipp.png","language":"Swift","readme":"# NilCoalescingAssignmentOperators\n\nNilCoalescingAssignmentOperators is Swift micro-library that provides two nil-coalescing/assignment-combo operators:\n\n## `??=`\n\n**`aVariable ??= newValue`** performs the value assignment if `aVariable` is nil _(like Ruby's `||=` operator)_:\n\n1. If `aVariable` is non-nil, does nothing.\n2. If `aVariable` is nil but `newValue` is non-nil, does the assignment: `aVariable = newValue`\n3. If `aVariable` \u0026 `newValue` are both nil, does nothing.\n\n```swift\naVariable ??= newValue\n```\nis equivalent to:\n\n```swift\n// roughly:\naVariable = aVariable ?? newValue\n\n// precisely:\nif aVariable == nil { aVariable = newValue }\n```\n\n## `=??`\n\n**`aVariable =?? newValue`** performs the value assignment if `newValue` is non-nil _(like `??=` but prefers the `newValue` over the `aVariable`)_:\n\n1. If `newValue` is nil, does nothing.\n2. If `newValue` is non-nil, does the assignment: `aVariable = newValue`\n3. If `aVariable` \u0026 `newValue` are both non-nil, still does the assignment.\n\n\n```swift\naVariable =?? newValue\n```\nis equivalent to:\n\n```swift\n// roughly:\naVariable = newValue ?? aVariable\n\n// precisely:\nif newValue != nil { aVariable = newValue }\n// or\nif let newValue { aVariable = newValue }\n```\n\n\n## Build Overlays\n\nThe master branch is Swift 5.x, and build overlays (the minimal changeset to the Package.swift, xcodeproj, and other build files) of the current library version are available on the [swift-4.2](https://github.com/capnslipp/NilCoalescingAssignmentOperators/tree/swift-4.2), [swift-4](https://github.com/capnslipp/NilCoalescingAssignmentOperators/tree/swift-4), and [swift-3](https://github.com/capnslipp/NilCoalescingAssignmentOperators/tree/swift-3) branches.  _(Note: I don't check that these are built as often as I used to when Swift 4.2 or 4.0 were the latest versions, but their changes haved worked and I've merged new library versions into them since then.)_\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapnslipp%2Fnilcoalescingassignmentoperators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapnslipp%2Fnilcoalescingassignmentoperators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapnslipp%2Fnilcoalescingassignmentoperators/lists"}