class Rbs2ts::Converter::Types::Intersection

Public Instance Methods

to_ts() click to toggle source
# File lib/rbs2ts/converter/types.rb, line 117
def to_ts
  types_ts = type.types.map { |type|
    ts = Types::Resolver.to_ts(type)
    type.is_a?(::RBS::Types::Union) || type.is_a?(::RBS::Types::Optional) ? "(#{ts})" : ts
  }

  types_ts.join(' & ')
end