We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7ae1779 commit 549e7edCopy full SHA for 549e7ed
lib/core/util.js
@@ -409,6 +409,21 @@ function throwIfAborted (signal) {
409
}
410
411
412
+const hasToWellFormed = !!String.prototype.toWellFormed
413
+
414
+/**
415
+ * @param {string} val
416
+ */
417
+function toUSVString (val) {
418
+ if (hasToWellFormed) {
419
+ return `${val}`.toWellFormed()
420
+ } else if (nodeUtil.toUSVString) {
421
+ return nodeUtil.toUSVString(val)
422
+ }
423
424
+ return `${val}`
425
+}
426
427
const kEnumerableProperty = Object.create(null)
428
kEnumerableProperty.enumerable = true
429
@@ -418,7 +433,7 @@ module.exports = {
433
isDisturbed,
434
isErrored,
435
isReadable,
- toUSVString: nodeUtil.toUSVString || ((val) => `${val}`),
436
+ toUSVString,
437
isReadableAborted,
438
isBlobLike,
439
parseOrigin,
0 commit comments