We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
hasIntl
try-catch
1 parent 47c6fa5 commit ae48e46Copy full SHA for ae48e46
lib/url.js
@@ -1,14 +1,7 @@
1
'use strict';
2
3
-function importPunycode() {
4
- try {
5
- return process.binding('icu');
6
- } catch (e) {
7
- return require('punycode');
8
- }
9
-}
10
-
11
-const { toASCII } = importPunycode();
+const { toASCII } = process.binding('config').hasIntl ?
+ process.binding('icu') : require('punycode');
12
13
exports.parse = urlParse;
14
exports.resolve = urlResolve;
0 commit comments