summaryrefslogtreecommitdiff
path: root/lib/serializers/json.rb
blob: 1ed5d5dc3f5ad2e11260e1930767b1d42c327e65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

module Serializers
  # Make the resulting hash have deep indifferent access
  class JSON
    class << self
      def dump(obj)
        obj
      end

      def load(data)
        return if data.nil?

        Gitlab::Utils.deep_indifferent_access(data)
      end
    end
  end
end