Skip to content

Commit

Permalink
feat: Add support for FileIO
Browse files Browse the repository at this point in the history
  • Loading branch information
Beforerr committed May 27, 2024
1 parent e6fc837 commit c968e56
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/JSON.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ using .Serializations: Serialization, CommonSerialization,
# for pretty-printed (non-compact) output, JSONText must be re-parsed:
Writer.lower(json::JSONText) = parse(json.s)

# support for FileIO
# load(file::File{format"JSON"}, kwargs...) = parsefile(filename(file), kwargs...)
fileio_load(file; kwargs...) = parsefile(file.filename; kwargs...)
fileio_save(file, data) = write(file, json(data))

function _precompile_()
ccall(:jl_generating_output, Cint, ()) == 1 || return nothing
x = "{\"type\":\"callback\",\"data\":{\"callback\":1,\"result\":true,\"error\":false}}"
Expand Down

0 comments on commit c968e56

Please sign in to comment.