def normalized_title(title_string, type)
      return title_string if type != 'File'

      matches = title_string.match(%r{^(?<normalized_path>/|.+:/|.*[^/])/*\Z}m)
      matches[:normalized_path] || title_string
    end
def normalized_title(title_string, type)
      return title_string if type != 'File'

      matches = title_string.match(%r{^(?<normalized_path>/|.+:/|.*[^/])/*\Z}m)
      matches[:normalized_path] || title_string
    end
Private method: Given a title string, normalize it according to the rules
 used by puppet 4.10.x for file resource title normalization:
 https://github.com/puppetlabs/puppet/blob/4.10.x/lib/puppet/type/file.rb#L42