'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://'); };
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
index.js | File | 288 B | 0644 |
|
license | File | 1.09 KB | 0644 |
|
package.json | File | 1.58 KB | 0644 |
|
readme.md | File | 577 B | 0644 |
|