url-sanitizer 0.9.4 → 0.9.5

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.
@@ -1,588 +1,3 @@
1
- // bundle_wo_dompurify/lib/file/text-chars.json
2
- var text_chars_default = [
3
- 7,
4
- 8,
5
- 9,
6
- 10,
7
- 11,
8
- 12,
9
- 13,
10
- 27,
11
- 32,
12
- 33,
13
- 34,
14
- 35,
15
- 36,
16
- 37,
17
- 38,
18
- 39,
19
- 40,
20
- 41,
21
- 42,
22
- 43,
23
- 44,
24
- 45,
25
- 46,
26
- 47,
27
- 48,
28
- 49,
29
- 50,
30
- 51,
31
- 52,
32
- 53,
33
- 54,
34
- 55,
35
- 56,
36
- 57,
37
- 58,
38
- 59,
39
- 60,
40
- 61,
41
- 62,
42
- 63,
43
- 64,
44
- 65,
45
- 66,
46
- 67,
47
- 68,
48
- 69,
49
- 70,
50
- 71,
51
- 72,
52
- 73,
53
- 74,
54
- 75,
55
- 76,
56
- 77,
57
- 78,
58
- 79,
59
- 80,
60
- 81,
61
- 82,
62
- 83,
63
- 84,
64
- 85,
65
- 86,
66
- 87,
67
- 88,
68
- 89,
69
- 90,
70
- 91,
71
- 92,
72
- 93,
73
- 94,
74
- 95,
75
- 96,
76
- 97,
77
- 98,
78
- 99,
79
- 100,
80
- 101,
81
- 102,
82
- 103,
83
- 104,
84
- 105,
85
- 106,
86
- 107,
87
- 108,
88
- 109,
89
- 110,
90
- 111,
91
- 112,
92
- 113,
93
- 114,
94
- 115,
95
- 116,
96
- 117,
97
- 118,
98
- 119,
99
- 120,
100
- 121,
101
- 122,
102
- 123,
103
- 124,
104
- 125,
105
- 126,
106
- 128,
107
- 129,
108
- 130,
109
- 131,
110
- 132,
111
- 133,
112
- 134,
113
- 135,
114
- 136,
115
- 137,
116
- 138,
117
- 139,
118
- 140,
119
- 141,
120
- 142,
121
- 143,
122
- 144,
123
- 145,
124
- 146,
125
- 147,
126
- 148,
127
- 149,
128
- 150,
129
- 151,
130
- 152,
131
- 153,
132
- 154,
133
- 155,
134
- 156,
135
- 157,
136
- 158,
137
- 159,
138
- 160,
139
- 161,
140
- 162,
141
- 163,
142
- 164,
143
- 165,
144
- 166,
145
- 167,
146
- 168,
147
- 169,
148
- 170,
149
- 171,
150
- 172,
151
- 173,
152
- 174,
153
- 175,
154
- 176,
155
- 177,
156
- 178,
157
- 179,
158
- 180,
159
- 181,
160
- 182,
161
- 183,
162
- 184,
163
- 185,
164
- 186,
165
- 187,
166
- 188,
167
- 189,
168
- 190,
169
- 191,
170
- 192,
171
- 193,
172
- 194,
173
- 195,
174
- 196,
175
- 197,
176
- 198,
177
- 199,
178
- 200,
179
- 201,
180
- 202,
181
- 203,
182
- 204,
183
- 205,
184
- 206,
185
- 207,
186
- 208,
187
- 209,
188
- 210,
189
- 211,
190
- 212,
191
- 213,
192
- 214,
193
- 215,
194
- 216,
195
- 217,
196
- 218,
197
- 219,
198
- 220,
199
- 221,
200
- 222,
201
- 223,
202
- 224,
203
- 225,
204
- 226,
205
- 227,
206
- 228,
207
- 229,
208
- 230,
209
- 231,
210
- 232,
211
- 233,
212
- 234,
213
- 235,
214
- 236,
215
- 237,
216
- 238,
217
- 239,
218
- 240,
219
- 241,
220
- 242,
221
- 243,
222
- 244,
223
- 245,
224
- 246,
225
- 247,
226
- 248,
227
- 249,
228
- 250,
229
- 251,
230
- 252,
231
- 253,
232
- 254,
233
- 255
234
- ];
235
-
236
- // bundle_wo_dompurify/lib/iana/uri-schemes.json
237
- var uri_schemes_default = [
238
- "aaa",
239
- "aaas",
240
- "about",
241
- "acap",
242
- "acct",
243
- "acd",
244
- "acr",
245
- "adiumxtra",
246
- "adt",
247
- "afp",
248
- "afs",
249
- "aim",
250
- "amss",
251
- "android",
252
- "appdata",
253
- "apt",
254
- "ar",
255
- "ark",
256
- "attachment",
257
- "aw",
258
- "barion",
259
- "beshare",
260
- "bitcoin",
261
- "bitcoincash",
262
- "blob",
263
- "bolo",
264
- "browserext",
265
- "cabal",
266
- "calculator",
267
- "callto",
268
- "cap",
269
- "cast",
270
- "casts",
271
- "chrome",
272
- "chrome-extension",
273
- "cid",
274
- "coap",
275
- "coaps",
276
- "com-eventbrite-attendee",
277
- "content",
278
- "content-type",
279
- "crid",
280
- "cstr",
281
- "cvs",
282
- "dab",
283
- "dat",
284
- "data",
285
- "dav",
286
- "diaspora",
287
- "dict",
288
- "did",
289
- "dis",
290
- "dlna-playcontainer",
291
- "dlna-playsingle",
292
- "dns",
293
- "dntp",
294
- "doi",
295
- "dpp",
296
- "drm",
297
- "dtmi",
298
- "dtn",
299
- "dvb",
300
- "dvx",
301
- "dweb",
302
- "ed2k",
303
- "eid",
304
- "elsi",
305
- "embedded",
306
- "ens",
307
- "ethereum",
308
- "example",
309
- "facetime",
310
- "feed",
311
- "feedready",
312
- "fido",
313
- "file",
314
- "finger",
315
- "first-run-pen-experience",
316
- "fish",
317
- "fm",
318
- "ftp",
319
- "fuchsia-pkg",
320
- "geo",
321
- "gg",
322
- "git",
323
- "gitoid",
324
- "gizmoproject",
325
- "go",
326
- "gopher",
327
- "graph",
328
- "gtalk",
329
- "h323",
330
- "ham",
331
- "hcap",
332
- "hcp",
333
- "http",
334
- "https",
335
- "hxxp",
336
- "hxxps",
337
- "hydrazone",
338
- "hyper",
339
- "iax",
340
- "icap",
341
- "icon",
342
- "im",
343
- "imap",
344
- "info",
345
- "iotdisco",
346
- "ipfs",
347
- "ipn",
348
- "ipns",
349
- "ipp",
350
- "ipps",
351
- "irc",
352
- "irc6",
353
- "ircs",
354
- "iris",
355
- "iris.beep",
356
- "iris.lwz",
357
- "iris.xpc",
358
- "iris.xpcs",
359
- "isostore",
360
- "itms",
361
- "jabber",
362
- "jar",
363
- "jms",
364
- "keyparc",
365
- "lastfm",
366
- "lbry",
367
- "ldap",
368
- "ldaps",
369
- "leaptofrogans",
370
- "lorawan",
371
- "lpa",
372
- "lvlt",
373
- "magnet",
374
- "mailto",
375
- "maps",
376
- "market",
377
- "matrix",
378
- "message",
379
- "microsoft.windows.camera",
380
- "microsoft.windows.camera.multipicker",
381
- "microsoft.windows.camera.picker",
382
- "mid",
383
- "mms",
384
- "mongodb",
385
- "moz",
386
- "moz-extension",
387
- "ms-access",
388
- "ms-appinstaller",
389
- "ms-browser-extension",
390
- "ms-calculator",
391
- "ms-drive-to",
392
- "ms-enrollment",
393
- "ms-excel",
394
- "ms-eyecontrolspeech",
395
- "ms-gamebarservices",
396
- "ms-gamingoverlay",
397
- "ms-getoffice",
398
- "ms-help",
399
- "ms-infopath",
400
- "ms-inputapp",
401
- "ms-lockscreencomponent-config",
402
- "ms-media-stream-id",
403
- "ms-meetnow",
404
- "ms-mixedrealitycapture",
405
- "ms-mobileplans",
406
- "ms-newsandinterests",
407
- "ms-officeapp",
408
- "ms-people",
409
- "ms-powerpoint",
410
- "ms-project",
411
- "ms-publisher",
412
- "ms-remotedesktop-launch",
413
- "ms-restoretabcompanion",
414
- "ms-screenclip",
415
- "ms-screensketch",
416
- "ms-search",
417
- "ms-search-repair",
418
- "ms-secondary-screen-controller",
419
- "ms-secondary-screen-setup",
420
- "ms-settings",
421
- "ms-settings-airplanemode",
422
- "ms-settings-bluetooth",
423
- "ms-settings-camera",
424
- "ms-settings-cellular",
425
- "ms-settings-cloudstorage",
426
- "ms-settings-connectabledevices",
427
- "ms-settings-displays-topology",
428
- "ms-settings-emailandaccounts",
429
- "ms-settings-language",
430
- "ms-settings-location",
431
- "ms-settings-lock",
432
- "ms-settings-nfctransactions",
433
- "ms-settings-notifications",
434
- "ms-settings-power",
435
- "ms-settings-privacy",
436
- "ms-settings-proximity",
437
- "ms-settings-screenrotation",
438
- "ms-settings-wifi",
439
- "ms-settings-workplace",
440
- "ms-spd",
441
- "ms-stickers",
442
- "ms-sttoverlay",
443
- "ms-transit-to",
444
- "ms-useractivityset",
445
- "ms-virtualtouchpad",
446
- "ms-visio",
447
- "ms-walk-to",
448
- "ms-whiteboard",
449
- "ms-whiteboard-cmd",
450
- "ms-word",
451
- "msnim",
452
- "msrp",
453
- "msrps",
454
- "mss",
455
- "mt",
456
- "mtqp",
457
- "mumble",
458
- "mupdate",
459
- "mvn",
460
- "news",
461
- "nfs",
462
- "ni",
463
- "nih",
464
- "nntp",
465
- "notes",
466
- "num",
467
- "ocf",
468
- "oid",
469
- "onenote",
470
- "onenote-cmd",
471
- "opaquelocktoken",
472
- "openpgp4fpr",
473
- "otpauth",
474
- "palm",
475
- "paparazzi",
476
- "payment",
477
- "payto",
478
- "pkcs11",
479
- "platform",
480
- "pop",
481
- "pres",
482
- "proxy",
483
- "psyc",
484
- "pttp",
485
- "pwid",
486
- "qb",
487
- "query",
488
- "quic-transport",
489
- "redis",
490
- "rediss",
491
- "reload",
492
- "res",
493
- "resource",
494
- "rmi",
495
- "rsync",
496
- "rtmfp",
497
- "rtmp",
498
- "rtsp",
499
- "rtsps",
500
- "rtspu",
501
- "sarif",
502
- "secondlife",
503
- "secret-token",
504
- "service",
505
- "session",
506
- "sftp",
507
- "sgn",
508
- "shc",
509
- "sieve",
510
- "simpleledger",
511
- "simplex",
512
- "sip",
513
- "sips",
514
- "skype",
515
- "smb",
516
- "smp",
517
- "sms",
518
- "smtp",
519
- "snmp",
520
- "soap.beep",
521
- "soap.beeps",
522
- "soldat",
523
- "spiffe",
524
- "spotify",
525
- "ssb",
526
- "ssh",
527
- "starknet",
528
- "steam",
529
- "stun",
530
- "stuns",
531
- "submit",
532
- "svn",
533
- "swh",
534
- "swid",
535
- "swidpath",
536
- "tag",
537
- "taler",
538
- "teamspeak",
539
- "tel",
540
- "teliaeid",
541
- "telnet",
542
- "tftp",
543
- "things",
544
- "thismessage",
545
- "tip",
546
- "tn3270",
547
- "tool",
548
- "turn",
549
- "turns",
550
- "tv",
551
- "udp",
552
- "unreal",
553
- "urn",
554
- "ut2004",
555
- "uuid-in-package",
556
- "v-event",
557
- "vemmi",
558
- "ventrilo",
559
- "ves",
560
- "view-source",
561
- "vnc",
562
- "vscode",
563
- "vscode-insiders",
564
- "vsls",
565
- "w3",
566
- "wcr",
567
- "web3",
568
- "webcal",
569
- "wifi",
570
- "ws",
571
- "wss",
572
- "wtai",
573
- "wyciwyg",
574
- "xcon",
575
- "xcon-userid",
576
- "xfire",
577
- "xmlrpc.beep",
578
- "xmlrpc.beeps",
579
- "xmpp",
580
- "xri",
581
- "ymsgr",
582
- "z39.50r",
583
- "z39.50s"
584
- ];
585
-
586
1
  // bundle_wo_dompurify/mjs/dompurify.js
587
2
  var { DOMPurify } = window;
588
3
 
@@ -592,22 +7,19 @@ var TYPE_TO = -1;
592
7
  var getType = (o) => Object.prototype.toString.call(o).slice(TYPE_FROM, TYPE_TO);
593
8
  var isString = (o) => typeof o === "string" || o instanceof String;
594
9
 
10
+ // bundle_wo_dompurify/lib/file/text-chars.json
11
+ var text_chars_default = [7, 8, 9, 10, 11, 12, 13, 27, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255];
12
+
13
+ // bundle_wo_dompurify/lib/iana/uri-schemes.json
14
+ var uri_schemes_default = ["aaa", "aaas", "about", "acap", "acct", "acd", "acr", "adiumxtra", "adt", "afp", "afs", "aim", "amss", "android", "appdata", "apt", "ar", "ark", "attachment", "aw", "barion", "beshare", "bitcoin", "bitcoincash", "blob", "bolo", "browserext", "cabal", "calculator", "callto", "cap", "cast", "casts", "chrome", "chrome-extension", "cid", "coap", "coaps", "com-eventbrite-attendee", "content", "content-type", "crid", "cstr", "cvs", "dab", "dat", "data", "dav", "diaspora", "dict", "did", "dis", "dlna-playcontainer", "dlna-playsingle", "dns", "dntp", "doi", "dpp", "drm", "dtmi", "dtn", "dvb", "dvx", "dweb", "ed2k", "eid", "elsi", "embedded", "ens", "ethereum", "example", "facetime", "feed", "feedready", "fido", "file", "finger", "first-run-pen-experience", "fish", "fm", "ftp", "fuchsia-pkg", "geo", "gg", "git", "gitoid", "gizmoproject", "go", "gopher", "graph", "gtalk", "h323", "ham", "hcap", "hcp", "http", "https", "hxxp", "hxxps", "hydrazone", "hyper", "iax", "icap", "icon", "im", "imap", "info", "iotdisco", "ipfs", "ipn", "ipns", "ipp", "ipps", "irc", "irc6", "ircs", "iris", "iris.beep", "iris.lwz", "iris.xpc", "iris.xpcs", "isostore", "itms", "jabber", "jar", "jms", "keyparc", "lastfm", "lbry", "ldap", "ldaps", "leaptofrogans", "lorawan", "lpa", "lvlt", "magnet", "mailto", "maps", "market", "matrix", "message", "microsoft.windows.camera", "microsoft.windows.camera.multipicker", "microsoft.windows.camera.picker", "mid", "mms", "mongodb", "moz", "moz-extension", "ms-access", "ms-appinstaller", "ms-browser-extension", "ms-calculator", "ms-drive-to", "ms-enrollment", "ms-excel", "ms-eyecontrolspeech", "ms-gamebarservices", "ms-gamingoverlay", "ms-getoffice", "ms-help", "ms-infopath", "ms-inputapp", "ms-lockscreencomponent-config", "ms-media-stream-id", "ms-meetnow", "ms-mixedrealitycapture", "ms-mobileplans", "ms-newsandinterests", "ms-officeapp", "ms-people", "ms-powerpoint", "ms-project", "ms-publisher", "ms-remotedesktop-launch", "ms-restoretabcompanion", "ms-screenclip", "ms-screensketch", "ms-search", "ms-search-repair", "ms-secondary-screen-controller", "ms-secondary-screen-setup", "ms-settings", "ms-settings-airplanemode", "ms-settings-bluetooth", "ms-settings-camera", "ms-settings-cellular", "ms-settings-cloudstorage", "ms-settings-connectabledevices", "ms-settings-displays-topology", "ms-settings-emailandaccounts", "ms-settings-language", "ms-settings-location", "ms-settings-lock", "ms-settings-nfctransactions", "ms-settings-notifications", "ms-settings-power", "ms-settings-privacy", "ms-settings-proximity", "ms-settings-screenrotation", "ms-settings-wifi", "ms-settings-workplace", "ms-spd", "ms-stickers", "ms-sttoverlay", "ms-transit-to", "ms-useractivityset", "ms-virtualtouchpad", "ms-visio", "ms-walk-to", "ms-whiteboard", "ms-whiteboard-cmd", "ms-word", "msnim", "msrp", "msrps", "mss", "mt", "mtqp", "mumble", "mupdate", "mvn", "news", "nfs", "ni", "nih", "nntp", "notes", "num", "ocf", "oid", "onenote", "onenote-cmd", "opaquelocktoken", "openpgp4fpr", "otpauth", "palm", "paparazzi", "payment", "payto", "pkcs11", "platform", "pop", "pres", "proxy", "psyc", "pttp", "pwid", "qb", "query", "quic-transport", "redis", "rediss", "reload", "res", "resource", "rmi", "rsync", "rtmfp", "rtmp", "rtsp", "rtsps", "rtspu", "sarif", "secondlife", "secret-token", "service", "session", "sftp", "sgn", "shc", "sieve", "simpleledger", "simplex", "sip", "sips", "skype", "smb", "smp", "sms", "smtp", "snmp", "soap.beep", "soap.beeps", "soldat", "spiffe", "spotify", "ssb", "ssh", "starknet", "steam", "stun", "stuns", "submit", "svn", "swh", "swid", "swidpath", "tag", "taler", "teamspeak", "tel", "teliaeid", "telnet", "tftp", "things", "thismessage", "tip", "tn3270", "tool", "turn", "turns", "tv", "udp", "unreal", "urn", "ut2004", "uuid-in-package", "v-event", "vemmi", "ventrilo", "ves", "view-source", "vnc", "vscode", "vscode-insiders", "vsls", "w3", "wcr", "web3", "webcal", "wifi", "ws", "wss", "wtai", "wyciwyg", "xcon", "xcon-userid", "xfire", "xmlrpc.beep", "xmlrpc.beeps", "xmpp", "xri", "ymsgr", "z39.50r", "z39.50s"];
15
+
595
16
  // bundle_wo_dompurify/mjs/file-reader.js
596
17
  var { FileReader } = window;
597
18
 
598
19
  // bundle_wo_dompurify/mjs/uri-util.js
599
20
  var HEX = 16;
600
21
  var REG_BASE64 = /^[\da-z+/\-_=]+$/i;
601
- var REG_DATA_URL = /data:[^,]*,/;
602
- var REG_DATA_URL_BASE64 = /data:[^,]*;?base64,[\da-z+/\-_=]+/i;
603
- var REG_DATA_URL_G = /data:[^,]*,[^"]+/g;
604
22
  var REG_END_COLON = /:$/;
605
- var REG_END_NUM = /(?:#|%23)$/;
606
- var REG_END_QUEST = /(?<!(?:#|%23).*)(?:\?|%3F)$/;
607
- var REG_HTML_SP = /[<>"'\s]/g;
608
- var REG_HTML_URL_ENC = /%(?:2(?:2|7)|3(?:C|E))/g;
609
- var REG_HTML_URL_ENC_SHORT = /%(?:2(?:2|7)|3(?:C|E))+?/;
610
- var REG_MIME_DOM = /^(?:text\/(?:ht|x)ml|application\/(?:xhtml\+)?xml|image\/svg\+xml)/;
611
23
  var REG_NUM_DECI = /^\d+/;
612
24
  var REG_NUM_HEAD = /#x?$/;
613
25
  var REG_NUM_HEAD_ASCII = /^#(?:x(?:00)?[2-7]|\d)/;
@@ -616,9 +28,7 @@ var REG_NUM_REF = /&#(x(?:00)?[\dA-F]{2}|0?\d{1,3});?/ig;
616
28
  var REG_SCHEME = /^[a-z][\da-z+\-.]*$/;
617
29
  var REG_SCHEME_CUSTOM = /^(?:ext|web)\+[a-z]+$/;
618
30
  var REG_SCRIPT = /(?:java|vb)script/;
619
- var REG_SCRIPT_BLOB = /(?:java|vb)script|blob/;
620
31
  var REG_URL_ENC = /^%[\dA-F]{2}$/i;
621
- var REG_URL_ENC_AMP = /%26/g;
622
32
  var getURLEncodedString = (str) => {
623
33
  if (!isString(str)) {
624
34
  throw new TypeError(`Expected String but got ${getType(str)}.`);
@@ -789,6 +199,21 @@ var URISchemes = class {
789
199
  return !!res;
790
200
  }
791
201
  };
202
+
203
+ // bundle_wo_dompurify/mjs/sanitizer.js
204
+ var HEX2 = 16;
205
+ var REG_DATA_URL = /data:[^,]*,/;
206
+ var REG_DATA_URL_BASE64 = /data:[^,]*;?base64,[\da-z+/\-_=]+/i;
207
+ var REG_DATA_URL_G = /data:[^,]*,[^"]+/g;
208
+ var REG_END_COLON2 = /:$/;
209
+ var REG_END_NUM = /(?:#|%23)$/;
210
+ var REG_END_QUEST = /(?<!(?:#|%23).*)(?:\?|%3F)$/;
211
+ var REG_HTML_SP = /[<>"'\s]/g;
212
+ var REG_HTML_URL_ENC = /%(?:2(?:2|7)|3(?:C|E))/g;
213
+ var REG_HTML_URL_ENC_SHORT = /%(?:2(?:2|7)|3(?:C|E))+?/;
214
+ var REG_MIME_DOM = /^(?:text\/(?:ht|x)ml|application\/(?:xhtml\+)?xml|image\/svg\+xml)/;
215
+ var REG_SCRIPT_BLOB = /(?:java|vb)script|blob/;
216
+ var REG_URL_ENC_AMP = /%26/g;
792
217
  var URLSanitizer = class extends URISchemes {
793
218
  /* private fields */
794
219
  #nest;
@@ -871,7 +296,7 @@ var URLSanitizer = class extends URISchemes {
871
296
  * @returns {?string} - sanitized URL
872
297
  */
873
298
  sanitize(url, opt = { allow: [], deny: [], only: [] }) {
874
- if (this.#nest > HEX) {
299
+ if (this.#nest > HEX2) {
875
300
  this.#nest = 0;
876
301
  throw new Error("Data URLs nested too deeply.");
877
302
  }
@@ -948,7 +373,7 @@ var URLSanitizer = class extends URISchemes {
948
373
  let sanitizedUrl;
949
374
  if (super.verify(url)) {
950
375
  const { hash, href, pathname, protocol, search } = new URL(url);
951
- const scheme = protocol.replace(REG_END_COLON, "");
376
+ const scheme = protocol.replace(REG_END_COLON2, "");
952
377
  const schemeParts = scheme.split("+");
953
378
  let bool;
954
379
  if (restrictScheme) {
@@ -977,7 +402,7 @@ var URLSanitizer = class extends URISchemes {
977
402
  try {
978
403
  const decodedData = parseURLEncodedNumCharRef(parsedData).trim();
979
404
  const { protocol: dataScheme } = new URL(decodedData);
980
- const dataSchemeParts = dataScheme.replace(REG_END_COLON, "").split("+");
405
+ const dataSchemeParts = dataScheme.replace(REG_END_COLON2, "").split("+");
981
406
  if (dataSchemeParts.some((s) => REG_SCRIPT_BLOB.test(s))) {
982
407
  urlToSanitize = "";
983
408
  }
@@ -1063,7 +488,7 @@ var URLSanitizer = class extends URISchemes {
1063
488
  if (sanitizedUrl) {
1064
489
  const urlObj = new URL(sanitizedUrl);
1065
490
  const { pathname, protocol } = urlObj;
1066
- const schemeParts = protocol.replace(REG_END_COLON, "").split("+");
491
+ const schemeParts = protocol.replace(REG_END_COLON2, "").split("+");
1067
492
  const isDataUrl = schemeParts.includes("data");
1068
493
  parsedUrl.set("valid", true);
1069
494
  if (isDataUrl) {
@@ -1095,32 +520,6 @@ var URLSanitizer = class extends URISchemes {
1095
520
  }
1096
521
  };
1097
522
  var urlSanitizer = new URLSanitizer();
1098
- var isURISync = (uri) => urlSanitizer.verify(uri);
1099
- var isURI = async (uri) => {
1100
- const res = urlSanitizer.verify(uri);
1101
- return res;
1102
- };
1103
- var parseURLSync = (url) => urlSanitizer.parse(url);
1104
- var parseURL = async (url) => {
1105
- const res = urlSanitizer.parse(url);
1106
- return res;
1107
- };
1108
- var sanitizeURLSync = (url, opt) => {
1109
- let res;
1110
- if (urlSanitizer.verify(url)) {
1111
- const { protocol } = new URL(url);
1112
- if (protocol === "blob:") {
1113
- URL.revokeObjectURL(url);
1114
- } else {
1115
- res = urlSanitizer.sanitize(url, opt ?? {
1116
- allow: [],
1117
- deny: [],
1118
- only: []
1119
- });
1120
- }
1121
- }
1122
- return res || null;
1123
- };
1124
523
  var sanitizeURL = async (url, opt = {
1125
524
  allow: [],
1126
525
  deny: [],
@@ -1161,6 +560,32 @@ var sanitizeURL = async (url, opt = {
1161
560
  }
1162
561
  return res || null;
1163
562
  };
563
+ var sanitizeURLSync = (url, opt) => {
564
+ let res;
565
+ if (urlSanitizer.verify(url)) {
566
+ const { protocol } = new URL(url);
567
+ if (protocol === "blob:") {
568
+ URL.revokeObjectURL(url);
569
+ } else {
570
+ res = urlSanitizer.sanitize(url, opt ?? {
571
+ allow: [],
572
+ deny: [],
573
+ only: []
574
+ });
575
+ }
576
+ }
577
+ return res || null;
578
+ };
579
+ var parseURL = async (url) => {
580
+ const res = urlSanitizer.parse(url);
581
+ return res;
582
+ };
583
+ var parseURLSync = (url) => urlSanitizer.parse(url);
584
+ var isURI = async (uri) => {
585
+ const res = urlSanitizer.verify(uri);
586
+ return res;
587
+ };
588
+ var isURISync = (uri) => urlSanitizer.verify(uri);
1164
589
  export {
1165
590
  urlSanitizer as default,
1166
591
  isURI,