Current Folder

This commit is contained in:
Luis Fernando Molina committed 2020-11-20 14:05:59 +01:00
1 parent 8b3382289b
commit cfcada880d
4379 files changed

No files matched your search

-15
View File
@@ -1,15 +0,0 @@
'use strict';
module.exports = (url, opts) => {
if (typeof url !== 'string') {
throw new TypeError(`Expected \`url\` to be of type \`string\`, got \`${typeof url}\``);
}
url = url.trim();
opts = Object.assign({https: false}, opts);
if (/^\.*\/|^(?!localhost)\w+:/.test(url)) {
return url;
}
return url.replace(/^(?!(?:\w+:)?\/\/)/, opts.https ? 'https://' : 'http://');
};
-39
View File
@@ -1,39 +0,0 @@
{
"name": "prepend-http",
"version": "2.0.0",
"description": "Prepend `http://` to humanized URLs like todomvc.com and localhost",
"license": "MIT",
"repository": "sindresorhus/prepend-http",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"prepend",
"protocol",
"scheme",
"url",
"uri",
"http",
"https",
"humanized"
],
"devDependencies": {
"ava": "*",
"xo": "*"
}
,"_resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz"
,"_integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc="
,"_from": "prepend-http@^2.0.0"
}