Module: Dependabot::Nuget::HttpResponseHelpers

Extended by:
T::Sig
Defined in:
lib/dependabot/nuget/http_response_helpers.rb

Class Method Summary collapse

Class Method Details

.remove_wrapping_zero_width_chars(string) ⇒ Object



12
13
14
15
16
# File 'lib/dependabot/nuget/http_response_helpers.rb', line 12

def self.remove_wrapping_zero_width_chars(string)
  string.force_encoding("UTF-8").encode
        .gsub(/\A[\u200B-\u200D\uFEFF]/, "")
        .gsub(/[\u200B-\u200D\uFEFF]\Z/, "")
end