Sha256: e56b4b2be3ef71c675d64f68941dae2e8b557befe7fafe2526d4d0f03c303585

Contents?: true

Size: 267 Bytes

Versions: 2

Compression:

Stored size: 267 Bytes

Contents

# frozen_string_literal: true

module I18nJS
  def self.clean_hash(hash)
    hash.keys.each_with_object({}) do |key, buffer|
      value = hash[key]

      next if value.is_a?(Proc)

      buffer[key] = value.is_a?(Hash) ? clean_hash(value) : value
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
i18n-js-4.2.3 lib/i18n-js/clean_hash.rb
i18n-js-4.2.2 lib/i18n-js/clean_hash.rb