You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,4 +7,4 @@ URL Tools is a helper library whose sole purpose is making that process just a l
7
7
-`ParsedUrl`, a wrapper for the standard WHATWG `URL` class that mixes in the domain and subdomain parsing from [`tldjs`](https://www.npmjs.com/package/tldjs). Serializing a `ParsedUrl` object to JSON also produces a broken out collection of its individual properties, rather than spitting out the `href` property, as is the `URL` class's habit.
8
8
- A collection set of helper functions for URL filtering and normalizing operations, including sorting querystring parameters, stripping social sharing cruft, remapping 'ww1', 'ww2', etc. subdomains to a single canonical one, identifying web vs. non-web URLs, flagging urls on public hosting like S3, and more.
9
9
-`NormalizedUrl`, a version of `ParsedUrl` that applies one of those normalizer functions automatically on instantiation. Functions that accept a `URL` or `ParsedURL` as a parameter can use `if (url instanceof NormalizedUrl)` to determine whether a given incoming URL has already been normalized. Yay.
10
-
-`UrlSet`, a generic set that stores, de-duplicates, and (when used in conjunction with `NormalizedUrl`) normalizes piles of Urls. It's a bit janky, since ES6's `Set` implementation only supports value comparison, and it relies on TypeScript's generics to handle child class behaviors. As such it maintains some inefficient internal collections and requires type be passed in as a Generic and as the first parameter to its constructor, like so: `new UrlSet<NormalizedUrl>(NormalizedUrl, urlStrings);`. Once you get past that annoyance it's a quick way to efficiently take a pile of strings and turn them into clean, consistently-formatted URLs..
10
+
-`UrlSet`, `ParsedUrlSet`, and `NormalizedUrlSet`, a trio of Set classes that store, de-duplicate, and normalize piles of Urls in bulk. It's a bit fussy with bulk adding of relative URLs, but you can pass in a 'fallback base url' that helps in some circumstances.
0 commit comments