url-sanitizer 2.0.12 → 2.0.13
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/dist/url-sanitizer-wo-dompurify.min.js +1 -1
- package/dist/url-sanitizer-wo-dompurify.min.js.map +3 -3
- package/dist/url-sanitizer.min.js +1 -1
- package/dist/url-sanitizer.min.js.map +3 -3
- package/package.json +1 -1
- package/src/mjs/file-reader.js +4 -8
- package/src/mjs/sanitizer.js +3 -3
- package/types/mjs/file-reader.d.ts +2 -2
- package/types/mjs/sanitizer.d.ts +16 -16
package/package.json
CHANGED
package/src/mjs/file-reader.js
CHANGED
|
@@ -67,10 +67,10 @@ export class ProgressEvent extends Event {
|
|
|
67
67
|
*/
|
|
68
68
|
export class FileReader extends EventTarget {
|
|
69
69
|
/* private fields */
|
|
70
|
-
#error;
|
|
71
|
-
#state;
|
|
72
|
-
#result;
|
|
73
|
-
#terminate;
|
|
70
|
+
#error = null;
|
|
71
|
+
#state = EMPTY;
|
|
72
|
+
#result = null;
|
|
73
|
+
#terminate = false;
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* construct
|
|
@@ -80,10 +80,6 @@ export class FileReader extends EventTarget {
|
|
|
80
80
|
this.EMPTY = EMPTY;
|
|
81
81
|
this.LOADING = LOADING;
|
|
82
82
|
this.DONE = DONE;
|
|
83
|
-
this.#error = null;
|
|
84
|
-
this.#state = this.EMPTY;
|
|
85
|
-
this.#result = null;
|
|
86
|
-
this.#terminate = false;
|
|
87
83
|
}
|
|
88
84
|
|
|
89
85
|
/* getter */
|
package/src/mjs/sanitizer.js
CHANGED
|
@@ -39,10 +39,10 @@ import {
|
|
|
39
39
|
/**
|
|
40
40
|
* URL sanitizer
|
|
41
41
|
*/
|
|
42
|
-
|
|
42
|
+
class URLSanitizer extends URISchemes {
|
|
43
43
|
/* private fields */
|
|
44
44
|
#nest;
|
|
45
|
-
#recurse;
|
|
45
|
+
#recurse = new Set();
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* construct
|
|
@@ -50,7 +50,6 @@ export class URLSanitizer extends URISchemes {
|
|
|
50
50
|
constructor() {
|
|
51
51
|
super();
|
|
52
52
|
this.#nest = 0;
|
|
53
|
-
this.#recurse = new Set();
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
/**
|
|
@@ -364,6 +363,7 @@ export class URLSanitizer extends URISchemes {
|
|
|
364
363
|
this.#recurse.clear();
|
|
365
364
|
}
|
|
366
365
|
}
|
|
366
|
+
export { URLSanitizer };
|
|
367
367
|
|
|
368
368
|
/* aliases and async wrappers */
|
|
369
369
|
/* instance */
|
|
@@ -16,9 +16,9 @@ export class FileReader extends EventTarget {
|
|
|
16
16
|
EMPTY: number;
|
|
17
17
|
LOADING: number;
|
|
18
18
|
DONE: number;
|
|
19
|
-
get error():
|
|
19
|
+
get error(): null;
|
|
20
20
|
get readyState(): number;
|
|
21
|
-
get result():
|
|
21
|
+
get result(): null;
|
|
22
22
|
_dispatchProgressEvent(type: string): boolean;
|
|
23
23
|
abort(): void;
|
|
24
24
|
_read(blob: object, format: string, encoding?: string): Promise<void>;
|
package/types/mjs/sanitizer.d.ts
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
export class URLSanitizer extends URISchemes {
|
|
2
|
-
replace(data: string): string;
|
|
3
|
-
purify(dom: string): string;
|
|
4
|
-
sanitize(url: string, opt?: {
|
|
5
|
-
allow?: string[] | undefined;
|
|
6
|
-
deny?: string[] | undefined;
|
|
7
|
-
only?: string[] | undefined;
|
|
8
|
-
}): string | null;
|
|
9
|
-
parse(url: string, opt?: {
|
|
10
|
-
allow?: string[] | undefined;
|
|
11
|
-
deny?: string[] | undefined;
|
|
12
|
-
only?: string[] | undefined;
|
|
13
|
-
}): ParsedURL;
|
|
14
|
-
#private;
|
|
15
|
-
}
|
|
16
1
|
export function sanitizeURL(url: string, opt?: {
|
|
17
2
|
allow?: string[] | undefined;
|
|
18
3
|
deny?: string[] | undefined;
|
|
@@ -48,5 +33,20 @@ export type ParsedURL = {
|
|
|
48
33
|
search?: string | undefined;
|
|
49
34
|
hash?: string | undefined;
|
|
50
35
|
};
|
|
51
|
-
|
|
36
|
+
export class URLSanitizer extends URISchemes {
|
|
37
|
+
replace(data: string): string;
|
|
38
|
+
purify(dom: string): string;
|
|
39
|
+
sanitize(url: string, opt?: {
|
|
40
|
+
allow?: string[] | undefined;
|
|
41
|
+
deny?: string[] | undefined;
|
|
42
|
+
only?: string[] | undefined;
|
|
43
|
+
}): string | null;
|
|
44
|
+
parse(url: string, opt?: {
|
|
45
|
+
allow?: string[] | undefined;
|
|
46
|
+
deny?: string[] | undefined;
|
|
47
|
+
only?: string[] | undefined;
|
|
48
|
+
}): ParsedURL;
|
|
49
|
+
#private;
|
|
50
|
+
}
|
|
52
51
|
declare const urlSanitizer: URLSanitizer;
|
|
52
|
+
import { URISchemes } from './uri-util.js';
|