url-sanitizer 0.5.1 → 0.5.3
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/README.md +16 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -77,7 +77,7 @@ const res5 = await sanitizeURL('http://example.com', {
|
|
|
77
77
|
const res6 = await sanitizeURL('https://example.com/"onmouseover="alert(1)"', {
|
|
78
78
|
only: ['data', 'git', 'https']
|
|
79
79
|
}).then(res => decodeURIComponent(res));
|
|
80
|
-
// => https://example.com/"onmouseover="alert(1)"
|
|
80
|
+
// => 'https://example.com/"onmouseover="alert(1)"'
|
|
81
81
|
|
|
82
82
|
const res7 = await sanitizeURL('data:text/html,<script>alert(1);</script>', {
|
|
83
83
|
only: ['data', 'git', 'https']
|
|
@@ -88,7 +88,7 @@ const res7 = await sanitizeURL('data:text/html,<script>alert(1);</script>', {
|
|
|
88
88
|
const res8 = await sanitizeURL('git+https://example.com', {
|
|
89
89
|
only: ['data', 'git', 'https']
|
|
90
90
|
}).then(res => decodeURIComponent(res));;
|
|
91
|
-
// => git+https://example.com
|
|
91
|
+
// => 'git+https://example.com'
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
|
|
@@ -244,7 +244,7 @@ Returns **[Array][4]<[string][1]>** Array of registered URI schemes.
|
|
|
244
244
|
|
|
245
245
|
```javascript
|
|
246
246
|
const schemes = urlSanitizer.get();
|
|
247
|
-
// => ['aaa', 'aaas', 'about', 'acap', 'acct', ...]
|
|
247
|
+
// => ['aaa', 'aaas', 'about', 'acap', 'acct', ...]
|
|
248
248
|
```
|
|
249
249
|
|
|
250
250
|
### urlSanitizer.has(scheme)
|
|
@@ -281,7 +281,7 @@ console.log(isURISync('foo'));
|
|
|
281
281
|
// => false;
|
|
282
282
|
|
|
283
283
|
const res = urlSanitizer.add('foo');
|
|
284
|
-
// => ['aaa', 'aaas', 'about', 'acap', ... 'foo', ...]
|
|
284
|
+
// => ['aaa', 'aaas', 'about', 'acap', ... 'foo', ...]
|
|
285
285
|
|
|
286
286
|
console.log(isURISync('foo'));
|
|
287
287
|
// => true;
|
|
@@ -312,6 +312,18 @@ const res2 = urlSanitizer.remove('foo');
|
|
|
312
312
|
// => false
|
|
313
313
|
```
|
|
314
314
|
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
## Acknowledgments
|
|
318
|
+
|
|
319
|
+
The following resources have been of great help in the development of the URL Sanitizer.
|
|
320
|
+
|
|
321
|
+
* [Uniform Resource Identifier (URI) Schemes - IANA](https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml)
|
|
322
|
+
* [Encoding -- determine the character encoding of a text file. - file/file](https://github.com/file/file/blob/master/src/encoding.c)
|
|
323
|
+
|
|
324
|
+
---
|
|
325
|
+
Copyright (c) 2023 [asamuzaK (Kazz)](https://github.com/asamuzaK/)
|
|
326
|
+
|
|
315
327
|
[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
316
328
|
|
|
317
329
|
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
|
package/package.json
CHANGED