Sha256: a22d430f7f99d9a14d658d0e41382f1287c89683fe60734b0cd2924be11b26ac
Contents?: true
Size: 599 Bytes
Versions: 20
Compression:
Stored size: 599 Bytes
Contents
module Appsignal module Utils def self.sanitize(params, only_top_level=false) if params.is_a?(Hash) {}.tap do |hsh| params.each do |key, val| hsh[key] = only_top_level ? '?' : sanitize(val, only_top_level) end end elsif params.is_a?(Array) if only_top_level sanitize(params[0], only_top_level) elsif params.first.is_a?(String) ['?'] else params.map do |item| sanitize(item, only_top_level) end end else '?' end end end end
Version data entries
20 entries across 20 versions & 1 rubygems