mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-02 22:42:26 -04:00
* fix: bump `normalize-package-data` to 7.0.1 * fix: polyfill `URL.canParse` if not available * chore: update lockfile
22 lines
584 B
Diff
22 lines
584 B
Diff
diff --git a/lib/fixer.js b/lib/fixer.js
|
|
index 49b97f5e322e7acbd040806e04627cd1f1321915..c747f7cdea7afe2ac753514e3b37724a19e48cb4 100644
|
|
--- a/lib/fixer.js
|
|
+++ b/lib/fixer.js
|
|
@@ -10,6 +10,16 @@ var typos = require('./typos.json')
|
|
|
|
var isEmail = str => str.includes('@') && (str.indexOf('@') < str.lastIndexOf('.'))
|
|
|
|
+// polyfill until support for node <18.17.0 is dropped
|
|
+URL.canParse ??= (input, base) => {
|
|
+ try {
|
|
+ new URL(input, base);
|
|
+ return true;
|
|
+ } catch {
|
|
+ return false;
|
|
+ }
|
|
+}
|
|
+
|
|
module.exports = {
|
|
// default warning function
|
|
warn: function () {},
|