Skip to content

Make JSONToken.String.makeString() public#62

Merged
Joannis merged 2 commits into
masterfrom
copilot/make-json-token-string-public
Apr 27, 2026
Merged

Make JSONToken.String.makeString() public#62
Joannis merged 2 commits into
masterfrom
copilot/make-json-token-string-public

Conversation

Copilot AI commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

Users implementing JSONTokenizerDestination receive a JSONToken.String in stringFound() but had no public API to decode the raw bytes into a Swift String with proper escape handling — forcing them to copy-paste the internal implementation.

Changes

  • JSONToken.String.makeString(from:unicode:) — both the Span<UInt8> and [UInt8] overloads are now public

Usage

struct MyDestination: JSONTokenizerDestination {
    let bytes: [UInt8]

    mutating func stringFound(_ string: JSONToken.String) {
        let value = string.makeString(from: bytes, unicode: true)
        // use value
    }
}

Copilot AI linked an issue Apr 26, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Make JSONToken.String.makeString() public Make JSONToken.String.makeString() public Apr 26, 2026
Copilot AI requested a review from Joannis April 26, 2026 19:09
@Joannis Joannis marked this pull request as ready for review April 27, 2026 00:28
@Joannis Joannis merged commit c0d8aa3 into master Apr 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please make JSONToken.String.makeString() public

2 participants