mirror of
https://github.com/iv-org/protodec.git
synced 2024-12-21 13:45:16 -05:00
cast_json: enforce param type at compile time
This commit is contained in:
parent
11813ae363
commit
c6cede69e6
@ -468,9 +468,7 @@ module Protodec
|
||||
Any.new(raw.clone)
|
||||
end
|
||||
|
||||
def self.cast_json(object)
|
||||
raise "Invalid type" if !object.is_a?(Hash)
|
||||
|
||||
def self.cast_json(object : Hash)
|
||||
JSON::Any.new(object.transform_values do |value|
|
||||
case value
|
||||
when .is_a?(Hash)
|
||||
|
Loading…
Reference in New Issue
Block a user