Skip to content

Commit 46d3f0e

Browse files
authored
fix(next-url): print properly using logger symbol (#36097)
Hello, This PR adds a method to have a custom inspect for `NextURL` closes #35519
1 parent da6f271 commit 46d3f0e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

packages/next/server/web/next-url.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,23 @@ export class NextURL {
245245
return this.href
246246
}
247247

248+
[Symbol.for('edge-runtime.inspect.custom')]() {
249+
return {
250+
href: this.href,
251+
origin: this.origin,
252+
protocol: this.protocol,
253+
username: this.username,
254+
password: this.password,
255+
host: this.host,
256+
hostname: this.hostname,
257+
port: this.port,
258+
pathname: this.pathname,
259+
search: this.search,
260+
searchParams: this.searchParams,
261+
hash: this.hash,
262+
}
263+
}
264+
248265
clone() {
249266
return new NextURL(String(this), this[Internal].options)
250267
}

0 commit comments

Comments
 (0)