Sha256: 6d8cc291edd9edacbd7d8abc321bdef04e34844a6f3494429eeaa290678ef213
Contents?: true
Size: 596 Bytes
Versions: 12
Compression:
Stored size: 596 Bytes
Contents
# frozen_string_literal: true module R2OAS module Sortable def deep_sort(data, target) if data.is_a?(Hash) data.each_with_object({}) do |(key, value), result| result[key] = if key.eql? target if value.is_a?(Hash) Hash[value.sort] else value end else deep_sort(value, target) end end else data end end end end
Version data entries
12 entries across 12 versions & 1 rubygems