diff --git a/REQUIRE b/REQUIRE index 2d2625e3..dfbac391 100644 --- a/REQUIRE +++ b/REQUIRE @@ -2,3 +2,4 @@ julia 0.6 Missings Reexport Compat 0.39.0 +JSON \ No newline at end of file diff --git a/src/CategoricalArrays.jl b/src/CategoricalArrays.jl index 9c547c34..07af518c 100644 --- a/src/CategoricalArrays.jl +++ b/src/CategoricalArrays.jl @@ -18,6 +18,7 @@ module CategoricalArrays if VERSION >= v"0.7.0-DEV.3052" using Printf end + using JSON # FIXME make JSON optional dependency when core Julia will support that include("typedefs.jl") diff --git a/src/value.jl b/src/value.jl index bb28b28f..76ee2296 100644 --- a/src/value.jl +++ b/src/value.jl @@ -160,3 +160,6 @@ Base.match(r::Regex, s::CategoricalString, Base.matchall(r::Regex, s::CategoricalString, overlap::Bool=false) = matchall(r, get(s), overlap) Base.collect(x::CategoricalString) = collect(get(x)) + +# JSON of CatValue is JSON of the value it refers to +JSON.lower(x::CatValue) = get(x)