From 01cd545bf9954e1d9649e45b3ee252a55d6b8080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionic=C4=83=20Biz=C4=83u?= Date: Mon, 27 Jun 2022 11:53:42 +0300 Subject: [PATCH] :memo: --- example/index.js | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/example/index.js b/example/index.js index 086a4eb..8431a07 100644 --- a/example/index.js +++ b/example/index.js @@ -2,45 +2,46 @@ const parsePath = require("../lib") console.log(parsePath("http://ionicabizau.net/blog")) -// { protocols: [ 'http' ], +// { +// protocols: [ 'http' ], // protocol: 'http', -// port: null, +// port: '', // resource: 'ionicabizau.net', // user: '', +// password: '', // pathname: '/blog', // hash: '', // search: '', -// href: 'http://ionicabizau.net/blog' } +// href: 'http://ionicabizau.net/blog', +// query: {} +// } console.log(parsePath("http://domain.com/path/name?foo=bar&bar=42#some-hash")) -// { protocols: [ 'http' ], +// { +// protocols: [ 'http' ], // protocol: 'http', -// port: null, +// port: '', // resource: 'domain.com', // user: '', +// password: '', // pathname: '/path/name', // hash: 'some-hash', // search: 'foo=bar&bar=42', -// href: 'http://domain.com/path/name?foo=bar&bar=42#some-hash' } +// href: 'http://domain.com/path/name?foo=bar&bar=42#some-hash', +// query: { foo: 'bar', bar: '42' } +// } console.log(parsePath("git+ssh://git@host.xz/path/name.git")) -// { protocols: [ 'git', 'ssh' ], +// { +// protocols: [ 'git', 'ssh' ], // protocol: 'git', -// port: null, +// port: '', // resource: 'host.xz', // user: 'git', +// password: '', // pathname: '/path/name.git', // hash: '', // search: '', -// href: 'git+ssh://git@host.xz/path/name.git' } - -console.log(parsePath("git@github.com:IonicaBizau/git-stats.git")) -// { protocols: [], -// protocol: 'ssh', -// port: null, -// resource: 'github.com', -// user: 'git', -// pathname: '/IonicaBizau/git-stats.git', -// hash: '', -// search: '', -// href: 'git@github.com:IonicaBizau/git-stats.git' } +// href: 'git+ssh://git@host.xz/path/name.git', +// query: {} +// }