Sha256: 8ae0aafe46a22c9749264195d058c90dc0ff5dca640d9765e4547672785b9ea5
Contents?: true
Size: 288 Bytes
Versions: 33
Compression:
Stored size: 288 Bytes
Contents
'use strict'; module.exports = function (url) { if (typeof url !== 'string') { throw new TypeError('Expected a string, got ' + typeof url); } url = url.trim(); if (/^\.*\/|^(?!localhost)\w+:/.test(url)) { return url; } return url.replace(/^(?!(?:\w+:)?\/\/)/, 'http://'); };
Version data entries
33 entries across 32 versions & 12 rubygems