Current Folder
This commit is contained in:
1 parent
8b3382289b
commit
cfcada880d
4379 files changed
No files matched your search
+28
@@ -0,0 +1,28 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
|
||||
// Copied from https://github.com/nodejs/node/blob/master/lib/internal/url.js
|
||||
|
||||
function urlToOptions(url) {
|
||||
var options = {
|
||||
protocol: url.protocol,
|
||||
hostname: url.hostname,
|
||||
hash: url.hash,
|
||||
search: url.search,
|
||||
pathname: url.pathname,
|
||||
path: `${url.pathname}${url.search}`,
|
||||
href: url.href
|
||||
};
|
||||
if (url.port !== '') {
|
||||
options.port = Number(url.port);
|
||||
}
|
||||
if (url.username || url.password) {
|
||||
options.auth = `${url.username}:${url.password}`;
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
|
||||
|
||||
module.exports = urlToOptions;
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"_from": "url-to-options@^1.0.1",
|
||||
"_id": "url-to-options@1.0.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=",
|
||||
"_location": "/url-to-options",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "url-to-options@^1.0.1",
|
||||
"name": "url-to-options",
|
||||
"escapedName": "url-to-options",
|
||||
"rawSpec": "^1.0.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/swarm-js/got"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz",
|
||||
"_shasum": "1505a03a289a48cbd7a434efbaeec5055f5633a9",
|
||||
"_spec": "url-to-options@^1.0.1",
|
||||
"_where": "C:\\Users\\Luis\\source\\repos\\AAMasters\\BackendServers\\node_modules\\swarm-js\\node_modules\\got",
|
||||
"author": {
|
||||
"name": "Steven Vachon",
|
||||
"email": "contact@svachon.com",
|
||||
"url": "https://www.svachon.com/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/stevenvachon/url-to-options/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Convert a WHATWG URL to an http(s).request options object.",
|
||||
"devDependencies": {
|
||||
"universal-url": "^1.0.0-alpha"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 4"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/stevenvachon/url-to-options#readme",
|
||||
"keywords": [
|
||||
"http",
|
||||
"https",
|
||||
"url",
|
||||
"whatwg"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "url-to-options",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/stevenvachon/url-to-options.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test.js"
|
||||
},
|
||||
"version": "1.0.1"
|
||||
}
|
||||
Reference in new issue
Block a user