schnee effeckt und fehler Korektur
This commit is contained in:
21
node_modules/url-to-options/LICENSE
generated
vendored
Normal file
21
node_modules/url-to-options/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017 Steven Vachon
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
29
node_modules/url-to-options/README.md
generated
vendored
Normal file
29
node_modules/url-to-options/README.md
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
# url-to-options [![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]
|
||||
|
||||
Convert a WHATWG [URL](https://developer.mozilla.org/en/docs/Web/API/URL) to an `http.request`/`https.request` options object.
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
[Node.js](http://nodejs.org/) `>= 4` is required. To install, type this at the command line:
|
||||
```shell
|
||||
npm install url-to-options
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const urlToOptions = require('url-to-options');
|
||||
|
||||
const url = new URL('http://user:pass@hostname:8080/');
|
||||
|
||||
const opts = urlToOptions(url);
|
||||
//-> { auth:'user:pass', port:8080, … }
|
||||
```
|
||||
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/url-to-options.svg
|
||||
[npm-url]: https://npmjs.org/package/url-to-options
|
||||
[travis-image]: https://img.shields.io/travis/stevenvachon/url-to-options.svg
|
||||
[travis-url]: https://travis-ci.org/stevenvachon/url-to-options
|
||||
28
node_modules/url-to-options/index.js
generated
vendored
Normal file
28
node_modules/url-to-options/index.js
generated
vendored
Normal file
@@ -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;
|
||||
24
node_modules/url-to-options/package.json
generated
vendored
Normal file
24
node_modules/url-to-options/package.json
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "url-to-options",
|
||||
"description": "Convert a WHATWG URL to an http(s).request options object.",
|
||||
"version": "1.0.1",
|
||||
"license": "MIT",
|
||||
"author": "Steven Vachon <contact@svachon.com> (https://www.svachon.com/)",
|
||||
"repository": "stevenvachon/url-to-options",
|
||||
"devDependencies": {
|
||||
"universal-url": "^1.0.0-alpha"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test.js"
|
||||
},
|
||||
"files": ["index.js"],
|
||||
"keywords": [
|
||||
"http",
|
||||
"https",
|
||||
"url",
|
||||
"whatwg"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user