@url-sanitize/clearurls 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +33 -0
- package/NOTICE +14 -0
- package/README.md +38 -0
- package/data/data.json +1984 -0
- package/data/metadata.json +6 -0
- package/dist/chunk-TAQSU2JX.js +1998 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +92 -0
- package/dist/raw.d.ts +6 -0
- package/dist/raw.js +12 -0
- package/dist/types-DHX4A7iO.d.ts +21 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
The @url-sanitize/clearurls package ships two layers with different licenses:
|
|
2
|
+
|
|
3
|
+
1. Source code in src/ (adapter, types, exports) — MIT License
|
|
4
|
+
2. Bundled rule data in data/data.json, derived from the ClearURLs Rules
|
|
5
|
+
repository (https://github.com/ClearURLs/Rules) — LGPL-3.0-only
|
|
6
|
+
|
|
7
|
+
The bundled data is reproduced from the ClearURLs project. ClearURLs is a
|
|
8
|
+
trademark of its respective authors; this package is not an official ClearURLs
|
|
9
|
+
product. See NOTICE for upstream attribution.
|
|
10
|
+
|
|
11
|
+
For the LGPL-3.0-only text, see: https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
12
|
+
|
|
13
|
+
MIT License (covering src/)
|
|
14
|
+
|
|
15
|
+
Copyright (c) 2026 Antonio Orionus
|
|
16
|
+
|
|
17
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
18
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
19
|
+
in the Software without restriction, including without limitation the rights
|
|
20
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
21
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
22
|
+
furnished to do so, subject to the following conditions:
|
|
23
|
+
|
|
24
|
+
The above copyright notice and this permission notice shall be included in all
|
|
25
|
+
copies or substantial portions of the Software.
|
|
26
|
+
|
|
27
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
28
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
29
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
30
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
31
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
32
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
33
|
+
SOFTWARE.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
@url-sanitize/clearurls bundles rule data from the ClearURLs project.
|
|
2
|
+
|
|
3
|
+
Upstream: https://github.com/ClearURLs/Rules
|
|
4
|
+
CDN feed: https://rules2.clearurls.xyz/data.minify.json
|
|
5
|
+
Hash file: https://rules2.clearurls.xyz/rules.minify.hash
|
|
6
|
+
License: LGPL-3.0-only
|
|
7
|
+
|
|
8
|
+
The ClearURLs project is maintained independently. This package is not
|
|
9
|
+
affiliated with or endorsed by the ClearURLs maintainers. The bundled data
|
|
10
|
+
is reproduced under the terms of LGPL-3.0-only.
|
|
11
|
+
|
|
12
|
+
Algorithm code (src/adapter.ts, src/types.ts) in this package was written
|
|
13
|
+
independently against the public ClearURLs rule spec and is licensed MIT.
|
|
14
|
+
The rules data file (data/data.json) is the LGPL-3.0-only portion.
|
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# @url-sanitize/clearurls
|
|
2
|
+
|
|
3
|
+
ClearURLs-compatible rule catalog and adapter for [`@url-sanitize/core`](../core).
|
|
4
|
+
|
|
5
|
+
Ships a snapshot of the ClearURLs ruleset, daily-synced from upstream
|
|
6
|
+
`https://rules2.clearurls.xyz/data.minify.json` with SHA256 verification.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm install @url-sanitize/core @url-sanitize/clearurls
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { compileSanitizer } from '@url-sanitize/core';
|
|
18
|
+
import { clearurlsCatalog } from '@url-sanitize/clearurls';
|
|
19
|
+
|
|
20
|
+
const sanitize = compileSanitizer(clearurlsCatalog);
|
|
21
|
+
sanitize('https://example.com/?utm_source=x');
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Raw access
|
|
25
|
+
|
|
26
|
+
If you need the unprocessed ClearURLs JSON shape (for custom adapters or
|
|
27
|
+
tooling), use the secondary entrypoint:
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { clearurlsRawData, clearurlsMetadata } from '@url-sanitize/clearurls/raw';
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## License
|
|
34
|
+
|
|
35
|
+
- `src/` (adapter, types) — **MIT**
|
|
36
|
+
- `data/data.json` (bundled ClearURLs ruleset) — **LGPL-3.0-only**
|
|
37
|
+
|
|
38
|
+
See [LICENSE](LICENSE) and [NOTICE](NOTICE).
|