Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

parse-url

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-url - npm Package Compare versions

Comparing version 6.0.4 to 6.0.5

47

lib/index.js
"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": [

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc