Skip to content

Commit

Permalink
Merge pull request #753 from ioquatix/json-dump-options
Browse files Browse the repository at this point in the history
Pass through all options if present.
  • Loading branch information
byroot authored Feb 18, 2025
2 parents aa5b7d6 + bea96e0 commit b86a47d
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions lib/json/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ def dump(obj, anIO = nil, limit = nil, kwargs = nil)

opts = JSON.dump_default_options
opts = opts.merge(:max_nesting => limit) if limit
opts = merge_dump_options(opts, **kwargs) if kwargs
opts = opts.merge(kwargs) if kwargs

begin
State.generate(obj, opts, anIO)
Expand All @@ -854,15 +854,6 @@ def self.iconv(to, from, string)
string.encode(to, from)
end

def merge_dump_options(opts, strict: NOT_SET)
opts = opts.merge(strict: strict) if NOT_SET != strict
opts
end

class << self
private :merge_dump_options
end

# JSON::Coder holds a parser and generator configuration.
#
# module MyApp
Expand Down

0 comments on commit b86a47d

Please # to comment.