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.
1 parent c37754c commit 4987dd1Copy full SHA for 4987dd1
lib/util.js
@@ -1,5 +1,7 @@
1
'use strict';
2
3
+const Url = require('url').Url;
4
+
5
const formatRegExp = /%[sdj%]/g;
6
exports.format = function(f) {
7
if (typeof f !== 'string') {
@@ -632,7 +634,8 @@ exports.inherits = function(ctor, superCtor) {
632
634
exports._extend = function(origin, add) {
633
635
// Don't do anything if add isn't an object
636
if (add === null || typeof add !== 'object') return origin;
- if (typeof add.toJSON === 'function') add = add.toJSON();
637
+ // For compatibility with Url objects
638
+ if (add instanceof Url) add = add.toJSON();
639
640
var keys = Object.keys(add);
641
var i = keys.length;
0 commit comments