File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ def parse
6363 # Ignore strings that look like closing braces garbage (e.g. "}", " ] ")
6464 next if new_json . is_a? ( String ) && new_json . strip . match? ( /^[}\] ]+$/ )
6565
66- json . pop if same_object_type ?( json . last , new_json )
66+ json . pop if both_hash ?( json . last , new_json )
6767 json << new_json
6868 end
6969 end
@@ -1121,7 +1121,7 @@ def skip_whitespaces_at(start_idx: 0)
11211121 res
11221122 end
11231123
1124- def same_object_type ?( obj1 , obj2 )
1124+ def both_hash ?( obj1 , obj2 )
11251125 obj1 . is_a? ( Hash ) && obj2 . is_a? ( Hash )
11261126 end
11271127
Original file line number Diff line number Diff line change @@ -700,7 +700,7 @@ def with_timeout(seconds = 1, &)
700700 context 'when provided tricky edge cases and malformed structures' do
701701 [
702702 # Duplicate keys: The parser splits this into two objects [{"k":"v1"}, {"k":"v2"}]
703- # The main loop then sees two Hashes and keeps the last one (same_object_type ? logic)
703+ # The main loop then sees two Hashes and keeps the last one (both_hash ? logic)
704704 {
705705 input : '{"key": "v1", "key": "v2"}' ,
706706 expected_output : JSON . dump ( { 'key' => 'v2' } )
You can’t perform that action at this time.
0 commit comments