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/package.json CHANGED
@@ -78,5 +78,5 @@
78
78
  "test:bdd": "http-server ./ -c-1 -o test/bdd/url-sanitizer.test.html",
79
79
  "tsc": "node scripts/index clean --dir=types -i && npx tsc"
80
80
  },
81
- "version": "2.0.12"
81
+ "version": "2.0.13"
82
82
  }
@@ -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 */
@@ -39,10 +39,10 @@ import {
39
39
  /**
40
40
  * URL sanitizer
41
41
  */
42
- export class URLSanitizer extends URISchemes {
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(): any;
19
+ get error(): null;
20
20
  get readyState(): number;
21
- get result(): any;
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>;
@@ -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
- import { URISchemes } from './uri-util.js';
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';