Skip to content

Commit fa57ad2

Browse files
authored
define JSON.lower(CatValue) (JuliaData#96)
fixes JuliaData#95 Introduces "hard" JSON dependency, which should be made optional once Julia provides the appropriate mechanisms.
1 parent aa30eea commit fa57ad2

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

REQUIRE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ julia 0.6
22
Missings
33
Reexport
44
Compat 0.39.0
5+
JSON

src/CategoricalArrays.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ module CategoricalArrays
1818
if VERSION >= v"0.7.0-DEV.3052"
1919
using Printf
2020
end
21+
using JSON # FIXME make JSON optional dependency when core Julia will support that
2122

2223
include("typedefs.jl")
2324

src/value.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,6 @@ Base.match(r::Regex, s::CategoricalString,
160160
Base.matchall(r::Regex, s::CategoricalString, overlap::Bool=false) =
161161
matchall(r, get(s), overlap)
162162
Base.collect(x::CategoricalString) = collect(get(x))
163+
164+
# JSON of CatValue is JSON of the value it refers to
165+
JSON.lower(x::CatValue) = get(x)

0 commit comments

Comments
 (0)