Sha256: 12603072b8f81894560bc87c79af9aac6c4b6ba9b011ff06f10d143e653dd280

Contents?: true

Size: 544 Bytes

Versions: 2

Compression:

Stored size: 544 Bytes

Contents

# typed: strict
# frozen_string_literal: true

require 'stream-chat/types'

module StreamChat
  extend T::Sig
  # For now we disable runtime type checks.
  # We will enable it with a major bump in the future,
  # but for now, let's just run a static type check.

  T::Sig::WithoutRuntime.sig { params(sort: T.nilable(T::Hash[String, Integer])).returns(SortArray) }
  def self.get_sort_fields(sort)
    sort_fields = T.let([], SortArray)
    sort&.each do |k, v|
      sort_fields << { field: k, direction: v }
    end
    sort_fields
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stream-chat-ruby-2.23.0 lib/stream-chat/util.rb
stream-chat-ruby-2.22.2 lib/stream-chat/util.rb