Skip to content

Releases: slevithan/parseuri

v3.0.1

22 May 22:41
Compare
Choose a tag to compare

First official version published on npm. Thanks to @galkn for the parseuri package name, which previously provided a fork of v1.2.2 of this library.

Improvements

  • Documentation updates.

v3.0.0

22 May 22:40
Compare
Choose a tag to compare

This is a minor update, but includes a breaking change for a minor feature.

Breaking Changes

  • Renamed setSld as setTlds, and removed the extremely limited, built-in list of top-level domains (TLDs) that was included for illustrative purposes.

New Features

  • Can remove TLD extensions by calling setTlds with an empty object.
  • Can provide multi-level extentions for TLDs.

Improvements

  • Added JSDoc TypeScript definitions.
  • Improved the demo page with additional options, etc.

v2.0.0

22 May 22:38
Compare
Choose a tag to compare

This is a major, breaking change that comes 17 years after v1.2.2. It updates parseUri’s API, adds new features, includes bug/security fixes, adds tests, uses modern JavaScript, becomes a truly universal URI parser, and remains tiny.

Breaking Changes

  • Renamed many URI part properties to better mach the built-in URL object and other URI libraries: sourcehref, userInfouserinfo, hosthostname, relativeresource, pathpathname, filefilename, anchorfragment, queryKeyqueryParams.
  • Updated queryParams to be returned as a URLSearchParams object, with support for multiple query keys with the same name.
  • Now uses what used to be called strict parsing mode by default.
  • The parsing mode is now specified via an argument (options: 'default', 'friendly').
  • Friendly parsing mode (formerly called loose mode) is now consistent with default mode in considering '/entry' to include {filename: 'entry'} rather than treating 'entry' as part of directory.
  • Removed parseUri.options properties, including the ability to rename URI keys or provide a non-standard query parser.

New Features

  • Added six new URI parts to result objects: origin, host, subdomain, domain, tld, suffix.
    • tld includes extensible support for second-level domains that should be treated as part of the top-level domain (ex: co.uk).
  • Added support for IPv6 addresses.

Improvements

  • Improved handling for web protocol (http, https, ws, wss, ftp) and protocol-relative URLs, for parsing accuracy and security.
  • Improved handling for URNs.
  • Added an extensive test suite.
  • Added a demo page for testing and comparison with v1, the built-in URL constructor, and other libraries.

Bug Fixes

  • Fixed an issue where @ in the resource led to incorrect parsing.
  • Fixed an ReDoS vulnerability with extremely long URIs that use @ in the resource.
  • Fixed numerous additional edge cases with atypical/invalid URIs.