From: 
Subject: Debian changes

The Debian packaging of node-braintree-sanitize-url is maintained in git, using a workflow
similar to the one described in dgit-maint-merge(7).
The Debian delta is represented by this one combined patch; there isn't a
patch queue that can be represented as a quilt series.

A detailed breakdown of the changes is available from their canonical
representation -- git commits in the packaging repository.
For example, to see the changes made by the Debian maintainer in the first
upload of upstream version 1.2.3, you could use:

    % git clone https://git.dgit.debian.org/node-braintree-sanitize-url
    % cd node-braintree-sanitize-url
    % git log --oneline 1.2.3..debian/1.2.3-1 -- . ':!debian'

(If you have dgit, use `dgit clone node-braintree-sanitize-url`, rather than plain `git clone`.)

We don't use debian/source/options single-debian-patch because it has bugs.
Therefore, NMUs etc. may nevertheless have made additional patches.

---

diff --git a/package.json b/package.json
index f6297ab..b7870c3 100644
--- a/package.json
+++ b/package.json
@@ -2,8 +2,22 @@
   "name": "@braintree/sanitize-url",
   "version": "7.1.2",
   "description": "A url sanitizer",
-  "main": "dist/index.js",
-  "types": "dist/index.d.ts",
+  "main": "./dist/index.cjs",
+  "module": "./dist/index.mjs",
+  "types": "./dist/index.d.mts",
+
+  "exports": {
+    ".": {
+      "import": "./dist/index.mjs",
+      "require": "./dist/index.cjs",
+      "types": "./dist/index.d.mts"
+    },
+    "./constants": {
+      "import": "./dist/constants.mjs",
+      "require": "./dist/constants.cjs",
+      "types": "./dist/constants.d.mts"
+    }
+  },
   "author": "",
   "scripts": {
     "prepublishOnly": "npm run build",
diff --git a/src/index.ts b/src/index.ts
index 83faca9..138a829 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -21,7 +21,12 @@ function decodeHtmlCharacters(str: string) {
 }
 
 function isValidUrl(url: string): boolean {
-  return URL.canParse(url);
+  try {
+    new URL(url);
+    return true;
+  } catch {
+    return false;
+  }
 }
 
 function decodeURI(uri: string): string {
diff --git a/tsconfig.json b/tsconfig.json
index 76db379..b52d465 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,11 +1,15 @@
 {
   "compilerOptions": {
     "outDir": "./dist",
+    "rootDir": "./src",
     "allowJs": true,
     "strict": true,
-    "target": "es5",
+    "target": "ES2019",
+    "moduleResolution": "node",
+    "ignoreDeprecations": "6.0",
     "resolveJsonModule": true,
-    "lib": ["es2015", "dom"]
+    "lib": ["ES2023", "DOM"],
+    "skipLibCheck": true
   },
   "include": ["./src/**/*"],
   "exclude": ["**/__tests__/*"]
