Skip to content

Commit

Permalink
define JSON.lower(CatValue)
Browse files Browse the repository at this point in the history
fixes #95
  • Loading branch information
alyst committed Jan 8, 2018
1 parent aa30eea commit d8a8b13
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions REQUIRE
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ julia 0.6
Missings
Reexport
Compat 0.39.0
JSON
1 change: 1 addition & 0 deletions src/CategoricalArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
3 changes: 3 additions & 0 deletions src/value.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit d8a8b13

Please sign in to comment.