url-to-options
Advanced tools
Comparing version 1.0.1 to 2.0.0
@@ -10,7 +10,9 @@ 'use strict'; | ||
protocol: url.protocol, | ||
hostname: url.hostname, | ||
hostname: typeof url.hostname === 'string' && url.hostname.startsWith('[') ? | ||
url.hostname.slice(1, -1) : | ||
url.hostname, | ||
hash: url.hash, | ||
search: url.search, | ||
pathname: url.pathname, | ||
path: `${url.pathname}${url.search}`, | ||
path: `${url.pathname || ''}${url.search || ''}`, | ||
href: url.href | ||
@@ -17,0 +19,0 @@ }; |
{ | ||
"name": "url-to-options", | ||
"description": "Convert a WHATWG URL to an http(s).request options object.", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"license": "MIT", | ||
"author": "Steven Vachon <contact@svachon.com> (https://www.svachon.com/)", | ||
"repository": "stevenvachon/url-to-options", | ||
"author": "Steven Vachon <contact@svachon.com> (https://svachon.com)", | ||
"repository": "github:stevenvachon/url-to-options", | ||
"devDependencies": { | ||
"universal-url": "^1.0.0-alpha" | ||
"semver": "^6.0.0", | ||
"universal-url": "^2.0.0" | ||
}, | ||
"engines": { | ||
"node": ">= 4" | ||
"node": ">=8" | ||
}, | ||
@@ -17,3 +18,5 @@ "scripts": { | ||
}, | ||
"files": ["index.js"], | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
@@ -20,0 +23,0 @@ "http", |
# 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. | ||
> Convert a WHATWG [`URL`](https://developer.mozilla.org/en/docs/Web/API/URL) to an `http.request`/`https.request` options object. | ||
@@ -8,3 +8,3 @@ | ||
[Node.js](http://nodejs.org/) `>= 4` is required. To install, type this at the command line: | ||
[Node.js](http://nodejs.org/) `>= 8` is required. To install, type this at the command line: | ||
```shell | ||
@@ -11,0 +11,0 @@ npm install url-to-options |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
3132
23
2