mirror of
https://github.com/iv-org/invidious.git
synced 2025-07-31 01:38:31 +00:00
Simplified JSONSkeleton / SkeletonValue situation
This commit is contained in:
parent
1b4ccf9026
commit
d8df81d562
@ -171,11 +171,10 @@ module JSONFilter
|
|||||||
end
|
end
|
||||||
|
|
||||||
class FieldsGrouper
|
class FieldsGrouper
|
||||||
alias JSONSkeleton = Hash(String, JSONSkeleton)
|
alias SkeletonValue = Hash(String, SkeletonValue)
|
||||||
alias SkeletonValue = Hash(String, JSONSkeleton)
|
|
||||||
|
|
||||||
def self.create_json_skeleton(fields_text : String) : SkeletonValue
|
def self.create_json_skeleton(fields_text : String) : SkeletonValue
|
||||||
root_hash = SkeletonValue.new
|
root_hash = {} of String => SkeletonValue
|
||||||
|
|
||||||
FieldsParser.parse_fields(fields_text) do |nest_list|
|
FieldsParser.parse_fields(fields_text) do |nest_list|
|
||||||
current_item = root_hash
|
current_item = root_hash
|
||||||
@ -183,7 +182,7 @@ module JSONFilter
|
|||||||
if current_item[key]?
|
if current_item[key]?
|
||||||
current_item = current_item[key]
|
current_item = current_item[key]
|
||||||
else
|
else
|
||||||
current_item[key] = SkeletonValue.new
|
current_item[key] = {} of String => SkeletonValue
|
||||||
current_item = current_item[key]
|
current_item = current_item[key]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user