Comparing version 6.0.4 to 6.0.5
"use strict"; | ||
// Dependencies | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
@@ -19,3 +17,3 @@ | ||
* @param {String} url The input url. | ||
* @param {Boolean|Object} normalize Whether to normalize the url or not. | ||
* @param {Boolean|Object} normalize Wheter to normalize the url or not. | ||
* Default is `false`. If `true`, the url will | ||
@@ -29,24 +27,19 @@ * be normalized. If an object, it will be the | ||
* | ||
* - `protocols` (Array): An array with the url protocols (usually it has one element). | ||
* - `protocol` (String): The first protocol, `"ssh"` (if the url is a ssh url) or `"file"`. | ||
* - `port` (null|Number): The domain port. | ||
* - `resource` (String): The url domain (including subdomains). | ||
* - `user` (String): The authentication user (usually for ssh urls). | ||
* - `pathname` (String): The url pathname. | ||
* - `hash` (String): The url hash. | ||
* - `search` (String): The url querystring value. | ||
* - `href` (String): The input url. | ||
* - `query` (Object): The url querystring, parsed as object. | ||
* - `protocols` (Array): An array with the url protocols (usually it has one element). | ||
* - `protocol` (String): The first protocol, `"ssh"` (if the url is a ssh url) or `"file"`. | ||
* - `port` (null|Number): The domain port. | ||
* - `resource` (String): The url domain (including subdomains). | ||
* - `user` (String): The authentication user (usually for ssh urls). | ||
* - `pathname` (String): The url pathname. | ||
* - `hash` (String): The url hash. | ||
* - `search` (String): The url querystring value. | ||
* - `href` (String): The input url. | ||
* - `query` (Object): The url querystring, parsed as object. | ||
*/ | ||
var parseUrl = function parseUrl(url) { | ||
function parseUrl(url) { | ||
var normalize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; | ||
// Constants | ||
var GIT_RE = /((git@|http(s)?:\/\/)([\w\.@]+)(\/|:))(([\~,\w,\-,\_,\/]+)(.git){0,1}((\/){0,1}))/; | ||
if (typeof url !== "string" || !url.trim()) { | ||
throw new Error("Invalid url."); | ||
} | ||
if (normalize) { | ||
@@ -60,20 +53,6 @@ if ((typeof normalize === "undefined" ? "undefined" : _typeof(normalize)) !== "object") { | ||
} | ||
var parsed = parsePath(url); | ||
// Potential git-ssh urls | ||
if (parsed.protocol === "file") { | ||
var matched = parsed.href.match(GIT_RE); | ||
if (matched) { | ||
parsed.protocols = ["ssh"]; | ||
parsed.protocol = "ssh"; | ||
parsed.resource = matched[4]; | ||
parsed.user = "git"; | ||
parsed.pathname = "/" + matched[6]; | ||
} | ||
} | ||
return parsed; | ||
}; | ||
} | ||
module.exports = parseUrl; |
{ | ||
"name": "parse-url", | ||
"version": "6.0.4", | ||
"version": "6.0.5", | ||
"description": "An advanced url parser supporting git urls too.", | ||
@@ -34,6 +34,6 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"is-ssh": "^1.4.0", | ||
"is-ssh": "^1.3.0", | ||
"normalize-url": "^6.1.0", | ||
"parse-path": "^5.0.0", | ||
"protocols": "^2.0.1" | ||
"parse-path": "^4.0.0", | ||
"protocols": "^1.4.0" | ||
}, | ||
@@ -40,0 +40,0 @@ "files": [ |
186
README.md
@@ -163,3 +163,3 @@ <!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. --> | ||
- **String** `url`: The input url. | ||
- **Boolean|Object** `normalize`: Whether to normalize the url or not. Default is `false`. If `true`, the url will | ||
- **Boolean|Object** `normalize`: Wheter to normalize the url or not. Default is `false`. If `true`, the url will | ||
be normalized. If an object, it will be the | ||
@@ -172,12 +172,12 @@ options object sent to [`normalize-url`](https://github.com/sindresorhus/normalize-url). | ||
- **Object** An object containing the following fields: | ||
- `protocols` (Array): An array with the url protocols (usually it has one element). | ||
- `protocol` (String): The first protocol, `"ssh"` (if the url is a ssh url) or `"file"`. | ||
- `port` (null|Number): The domain port. | ||
- `resource` (String): The url domain (including subdomains). | ||
- `user` (String): The authentication user (usually for ssh urls). | ||
- `pathname` (String): The url pathname. | ||
- `hash` (String): The url hash. | ||
- `search` (String): The url querystring value. | ||
- `href` (String): The input url. | ||
- `query` (Object): The url querystring, parsed as object. | ||
- `protocols` (Array): An array with the url protocols (usually it has one element). | ||
- `protocol` (String): The first protocol, `"ssh"` (if the url is a ssh url) or `"file"`. | ||
- `port` (null|Number): The domain port. | ||
- `resource` (String): The url domain (including subdomains). | ||
- `user` (String): The authentication user (usually for ssh urls). | ||
- `pathname` (String): The url pathname. | ||
- `hash` (String): The url hash. | ||
- `search` (String): The url querystring value. | ||
- `href` (String): The input url. | ||
- `query` (Object): The url querystring, parsed as object. | ||
@@ -240,121 +240,75 @@ | ||
- `stun` | ||
- `kakapo` | ||
- `@open-wa/wa-automate` | ||
- `kakapo` | ||
- `fuge-runner` | ||
- `url-local` | ||
- `parse-db-uri` | ||
- `url-local` | ||
- `fuge-runner` | ||
- `build-plugin-ssr` | ||
- `rucksack` | ||
- `warp-api` | ||
- `warp-server` | ||
- `robots-agent` | ||
- `normalize-ssh` | ||
- `xl-git-up` | ||
- `normalize-id` | ||
- `egg-muc-custom-loader` | ||
- `hologit` | ||
- `@enkeledi/react-native-week-month-date-picker` | ||
- `normalize-ssh` | ||
- `robots-agent` | ||
- `warp-api` | ||
- `normalize-id` | ||
- `xl-git-up` | ||
- `warp-server` | ||
- `vrt-cli` | ||
- `native-zip` | ||
- `normalize-ssh-url` | ||
- `eval-spider` | ||
- `ts-scraper` | ||
- `microbe.js` | ||
- `hubot-will-it-connect` | ||
- `deploy-versioning` | ||
- `xbuilder-forms` | ||
- `tumblr-text` | ||
- `ssh-host-manager` | ||
- `blitzzz` | ||
- `wander-cli` | ||
- `graphmilker` | ||
- `api-reach-react-native-fix` | ||
- `@roshub/api` | ||
- `verify-aws-sns-signature` | ||
- `@apardellass/react-native-audio-stream` | ||
- `l2forlerna` | ||
- `react-native-plugpag-wrapper` | ||
- `react-native-pulsator-native` | ||
- `@hstech/utils` | ||
- `react-native-kakao-maps` | ||
- `@geeky-apo/react-native-advanced-clipboard` | ||
- `native-apple-login` | ||
- `native-google-login` | ||
- `@jprustv/sulla-hotfix` | ||
- `vue-cli-plugin-ice-builder` | ||
- `@hemith/react-native-tnk` | ||
- `@kriblet/wa-automate` | ||
- `@notnuzzel/crawl` | ||
- `gitlab-backup-util-harduino` | ||
- `bilibili2local` | ||
- `miguelcostero-ng2-toasty` | ||
- `native-kakao-login` | ||
- `react-native-my-first-try-arun-ramya` | ||
- `react-native-kakao-maps` | ||
- `react-native-is7` | ||
- `react-native-ytximkit` | ||
- `react-native-payu-payment-testing` | ||
- `npm_one_1_2_3` | ||
- `react-native-biometric-authenticate` | ||
- `react-native-arunmeena1987` | ||
- `workpad` | ||
- `react-native-contact-list` | ||
- `rn-adyen-dropin` | ||
- `@positionex/position-sdk` | ||
- `begg` | ||
- `@corelmax/react-native-my2c2p-sdk` | ||
- `@dataparty/api` | ||
- `@felipesimmi/react-native-datalogic-module` | ||
- `@jprustv/sulla-hotfix` | ||
- `@hawkingnetwork/react-native-tab-view` | ||
- `heroku-wp-environment-sync` | ||
- `react-native-responsive-size` | ||
- `delta-screen` | ||
- `react-native-test-module-hhh` | ||
- `react-native-is7` | ||
- `@kriblet/wa-automate` | ||
- `@mergulhao/wa-automate` | ||
- `@jimengio/mocked-proxy` | ||
- `cli-live-tutorial` | ||
- `@buganto/client` | ||
- `@datalogic/react-native-datalogic-module` | ||
- `birken-react-native-community-image-editor` | ||
- `native-kakao-login` | ||
- `react-native-modal-progress-bar` | ||
- `@hawkingnetwork/react-native-tab-view` | ||
- `miguelcostero-ng2-toasty` | ||
- `vue-cli-plugin-ut-builder` | ||
- `cv-app-payment-adyen` | ||
- `react-native-flyy` | ||
- `drowl-base-theme-iconset` | ||
- `native-apple-login` | ||
- `react-native-cplus` | ||
- `npm_qwerty` | ||
- `ssh-host-manager` | ||
- `soajs.repositories` | ||
- `react-native-arunjeyam1987` | ||
- `react-native-bubble-chart` | ||
- `verify-aws-sns-signature` | ||
- `vrt-cli` | ||
- `vue-cli-plugin-ice-builder` | ||
- `react-native-flyy` | ||
- `graphmilker` | ||
- `native-zip` | ||
- `@apardellass/react-native-audio-stream` | ||
- `@geeky-apo/react-native-advanced-clipboard` | ||
- `@hsui/plugin-wss` | ||
- `blitzzz` | ||
- `candlelabssdk` | ||
- `@roshub/api` | ||
- `@saad27/react-native-bottom-tab-tour` | ||
- `generator-bootstrap-boilerplate-template` | ||
- `react-feedback-sdk` | ||
- `gitlab-backup-util-harduino` | ||
- `loast` | ||
- `npm_one_12_34_1_` | ||
- `npm_one_2_2` | ||
- `payutesting` | ||
- `react-native-sayhello-module` | ||
- `react-native-dsphoto-module` | ||
- `vue-cli-plugin-ut-builder` | ||
- `xbuilder-forms` | ||
- `tumblr-text` | ||
- `deploy-versioning` | ||
- `eval-spider` | ||
- `rn-custom-tabview` | ||
- `homebridge-pushcutter` | ||
- `@con-test/react-native-concent-common` | ||
- `@hstech/utils` | ||
- `@angga30prabu/wa-modified` | ||
- `birken-react-native-community-image-editor` | ||
- `get-tarball-cli` | ||
- `luojia-cli-dev` | ||
- `reac-native-arun-ramya-test` | ||
- `react-native-transtracker-library` | ||
- `react-native-pulsator-native` | ||
- `react-native-arun-ramya-test` | ||
- `react-native-arunramya151` | ||
- `react-native-plugpag-wrapper` | ||
- `workpad` | ||
- `ndla-source-map-resolver` | ||
- `@screeb/react-native` | ||
- `@lakutata-module/service` | ||
- `delta-screen` | ||
- `microbe.js` | ||
- `@buganto/client` | ||
- `@jimengio/mocked-proxy` | ||
- `@mockswitch/cli` | ||
- `soajs.repositories` | ||
- `@ntt_app/react-native-custom-notification` | ||
- `@ndla/source-map-resolver` | ||
- `angularvezba` | ||
- `api-reach-react-native-fix` | ||
- `astra-ufo-sdk` | ||
- `react-native-syan-photo-picker` | ||
- `@wecraftapps/react-native-use-keyboard` | ||
- `hui-plugin-wss` | ||
- `l2forlerna` | ||
- `native-google-login` | ||
- `raact-native-arunramya151` | ||
- `react-native-modal-progress-bar` | ||
- `react-native-test-module-hhh` | ||
- `react-native-jsi-device-info` | ||
- `react-native-badge-control` | ||
- `rn-tm-notify` | ||
- `wander-cli` | ||
- `ts-scraper` | ||
- `heroku-wp-environment-sync` | ||
- `hubot-will-it-connect` | ||
- `normalize-ssh-url` | ||
- `ba-js-cookie-banner` | ||
@@ -361,0 +315,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13363
65
342
+ Addedcall-bind@1.0.7(transitive)
+ Addeddecode-uri-component@0.2.2(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedfilter-obj@1.1.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedobject-inspect@1.13.3(transitive)
+ Addedparse-path@4.0.4(transitive)
+ Addedprotocols@1.4.8(transitive)
+ Addedqs@6.13.0(transitive)
+ Addedquery-string@6.14.1(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedside-channel@1.0.6(transitive)
+ Addedsplit-on-first@1.1.0(transitive)
+ Addedstrict-uri-encode@2.0.0(transitive)
- Removedparse-path@5.0.0(transitive)
Updatedis-ssh@^1.3.0
Updatedparse-path@^4.0.0
Updatedprotocols@^1.4.0