Skip to content

Commit

Permalink
fix StructTypes.construct(::Type{JSON.JSONText}
Browse files Browse the repository at this point in the history
  • Loading branch information
hhaensel committed Oct 17, 2023
1 parent c6a97fc commit aa1a03c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/StippleJSONExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ isdefined(Base, :get_extension) ? using JSON : using ..JSON
# pure proper JSON. For transmissions of bindings, though, we need to allow to pass object names.

JSON.JSONText(json::Stipple.JSONText) = JSON.JSONText(json.s)
JSON.show_json(io::JSON.Writer.CompactContext, s::JSON.Writer.CS, json::Stipple.JSONText) = write(io, json.s)
JSON.show_json(io::JSON.Writer.CompactContext, ::JSON.Writer.CS, json::Stipple.JSONText) = write(io, json.s)
JSON.Writer.lower(json::Stipple.JSONText) = json.s

Stipple.JSONText(json::JSON.JSONText) = Stipple.JSONText(json.s)
@inline StructTypes.StructType(::Type{JSON.JSONText}) = JSON3.RawType()
@inline StructTypes.construct(::Type{JSON.JSONText}, json::JSON3.RawValue) = JSONText(string(json))
@inline StructTypes.construct(::Type{JSON.JSONText}, json::JSON3.RawValue) = JSON.JSONText(string(json))
@inline JSON3.rawbytes(json::JSON.JSONText) = codeunits(json.s)

end

0 comments on commit aa1a03c

Please sign in to comment.