From 468f965a888189dfb9e20ee7f0e0a8ff95490eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionic=C4=83=20Biz=C4=83u?= Date: Mon, 27 Jun 2022 12:33:40 +0300 Subject: [PATCH] Updated docs --- README.md | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 0240745..83719d4 100644 --- a/README.md +++ b/README.md @@ -80,49 +80,65 @@ yarn add parse-url const parseUrl = require("parse-url") console.log(parseUrl("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(parseUrl("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' } +// } // If you want to parse fancy Git urls, turn off the automatic url normalization console.log(parseUrl("git+ssh://git@host.xz/path/name.git", false)) -// { 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' } +// href: 'git+ssh://git@host.xz/path/name.git', +// query: {} +// } console.log(parseUrl("git@github.com:IonicaBizau/git-stats.git", false)) -// { protocols: [], +// { +// protocols: [ 'ssh' ], // protocol: 'ssh', -// port: null, +// port: '', // resource: 'github.com', // user: 'git', +// password: '', // pathname: '/IonicaBizau/git-stats.git', // hash: '', // search: '', -// href: 'git@github.com:IonicaBizau/git-stats.git' } +// href: 'git@github.com:IonicaBizau/git-stats.git', +// query: {} +// } ```