url-sanitizer 2.0.1 → 2.0.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/package.json CHANGED
@@ -21,32 +21,35 @@
21
21
  },
22
22
  "types": "types/index.d.ts",
23
23
  "dependencies": {
24
- "dompurify": "^3.1.6",
25
- "jsdom": "^24.1.0"
24
+ "dompurify": "^3.1.7",
25
+ "jsdom": "^25.0.1"
26
26
  },
27
27
  "devDependencies": {
28
- "@babel/eslint-parser": "^7.24.7",
29
- "@babel/plugin-syntax-import-assertions": "^7.24.7",
28
+ "@babel/core": "^7.25.8",
29
+ "@babel/eslint-parser": "^7.25.8",
30
+ "@babel/plugin-syntax-import-attributes": "^7.25.7",
30
31
  "@types/dompurify": "^3.0.5",
31
32
  "@types/jsdom": "^21.1.7",
33
+ "@types/node": "^22.7.5",
32
34
  "c8": "^10.1.2",
33
35
  "chai": "^5.1.1",
34
36
  "commander": "^12.1.0",
35
37
  "copyfiles": "^2.4.1",
36
38
  "csvtojson": "^2.0.10",
37
- "esbuild": "^0.23.0",
38
- "eslint": "^8.57.0",
39
- "eslint-config-standard": "^17.1.0",
40
- "eslint-plugin-import": "^2.29.1",
41
- "eslint-plugin-jsdoc": "^48.6.0",
39
+ "esbuild": "^0.24.0",
40
+ "eslint": "^9.12.0",
41
+ "eslint-plugin-import-x": "^4.3.1",
42
+ "eslint-plugin-jsdoc": "^50.3.2",
42
43
  "eslint-plugin-regexp": "^2.6.0",
43
- "eslint-plugin-unicorn": "^54.0.0",
44
+ "eslint-plugin-unicorn": "^56.0.0",
45
+ "globals": "^15.11.0",
44
46
  "http-server": "^14.1.1",
45
- "mocha": "^10.6.0",
47
+ "mocha": "^10.7.3",
48
+ "neostandard": "^0.11.6",
46
49
  "npm-run-all": "^4.1.5",
47
- "sinon": "^18.0.0",
48
- "typescript": "^5.5.3",
49
- "undici": "^6.19.2"
50
+ "sinon": "^19.0.2",
51
+ "typescript": "^5.6.3",
52
+ "undici": "^6.20.0"
50
53
  },
51
54
  "scripts": {
52
55
  "build": "npm run include && npm run tsc && npm run lint && npm test && npm run copy && npm run bundle",
@@ -65,5 +68,5 @@
65
68
  "test-bdd": "http-server ./ -c-1 -o test/bdd/url-sanitizer.test.html",
66
69
  "tsc": "node modules/index clean --dir=types -i && npx tsc"
67
70
  },
68
- "version": "2.0.1"
71
+ "version": "2.0.3"
69
72
  }
@@ -1 +1 @@
1
- ["aaa","aaas","about","acap","acct","acd","acr","adiumxtra","adt","afp","afs","aim","amss","android","appdata","apt","ar","ark","at","attachment","aw","barion","beshare","bitcoin","bitcoincash","blob","bolo","brid","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","dhttp","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","hs20","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","lid","lorawan","lpa","lvlt","machineProvisioningProgressReporter","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-launchremotedesktop","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-recall","ms-remotedesktop","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","mvrp","mvrps","news","nfs","ni","nih","nntp","notes","num","ocf","oid","onenote","onenote-cmd","opaquelocktoken","openid","openpgp4fpr","otpauth","palm","paparazzi","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","thzp","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","xftp","xmlrpc.beep","xmlrpc.beeps","xmpp","xrcp","xri","ymsgr","z39.50r","z39.50s"]
1
+ ["aaa","aaas","about","acap","acct","acd","acr","adiumxtra","adt","afp","afs","aim","amss","android","appdata","apt","ar","ark","at","attachment","aw","barion","beshare","bitcoin","bitcoincash","blob","bluetooth","bolo","brid","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","dhttp","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","hs20","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","lid","lorawan","lpa","lvlt","machineProvisioningProgressReporter","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-launchremotedesktop","ms-lockscreencomponent-config","ms-media-stream-id","ms-meetnow","ms-mixedrealitycapture","ms-mobileplans","ms-newsandinterests","ms-officeapp","ms-people","ms-personacard","ms-powerpoint","ms-project","ms-publisher","ms-recall","ms-remotedesktop","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","mvrp","mvrps","news","nfs","ni","nih","nntp","notes","num","ocf","oid","onenote","onenote-cmd","opaquelocktoken","openid","openpgp4fpr","otpauth","palm","paparazzi","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","xftp","xmlrpc.beep","xmlrpc.beeps","xmpp","xrcp","xri","ymsgr","z39.50r","z39.50s"]
@@ -12,7 +12,7 @@ export const REG_B64 = /^[\w+/=-]+$/;
12
12
  export const REG_CHARSET = /^charset=([\w#&.;-]+)$/;
13
13
  export const REG_DATA_URL = /data:[\w#&+./;=-]*,/;
14
14
  export const REG_DATA_URL_B64 = /data:[\w#&+./;=^]*base64,[\w+/=-]+/i;
15
- export const REG_DATA_URL_G = /data:[\w#&+./;=-]*,[^"]+/g;
15
+ export const REG_DATA_URL_G = /data:[\w#&+./;=-]*,[^\x22]+/g;
16
16
  export const REG_NUM_REF = /&#(x(?:00)?[\dA-F]{2}|0?\d{1,3});?/gi;
17
17
  export const REG_MIME_DOM =
18
18
  /^(?:application\/(?:[\w#&.;-]+\+)?x|image\/svg\+x|text\/(?:ht|x))ml;?/;
@@ -21,5 +21,5 @@ export const REG_SCHEME = /^[a-z][\da-z+.-]*$/;
21
21
  export const REG_SCHEME_EXT = /^(?:ext|web)\+[a-z]+$/;
22
22
  export const REG_SCRIPT = /(?:java|vb)script/;
23
23
  export const REG_SCRIPT_BLOB = /(?:java|vb)script|blob/;
24
- export const REG_TAG_QUOT = /%(?:2[27]|3[CE])|[<>"']/;
24
+ export const REG_TAG_QUOT = /%(?:22|27|3C|3E)|[\x22\x27<>]/;
25
25
  export const REG_URL_ENC = /^%[\dA-F]{2}$/i;
@@ -107,7 +107,7 @@ export class URLSanitizer extends URISchemes {
107
107
  purifiedDom = purifiedDom.replace(/(?:#|%23)$/, '')
108
108
  .replace(/(?<!(?:#|%23).*)(?:\?|%3F)$/, '');
109
109
  return encodeURI(purifiedDom);
110
- };
110
+ }
111
111
 
112
112
  /**
113
113
  * sanitize URL
@@ -363,7 +363,7 @@ export class URLSanitizer extends URISchemes {
363
363
  this.#nest = 0;
364
364
  this.#recurse.clear();
365
365
  }
366
- };
366
+ }
367
367
 
368
368
  /* aliases and async wrappers */
369
369
  /* instance */
@@ -228,4 +228,4 @@ export class URISchemes {
228
228
  this.#schemes.add(scheme);
229
229
  }
230
230
  }
231
- };
231
+ }