(depth, opts)
| 860 | } |
| 861 | |
| 862 | [inspect.custom](depth, opts) { |
| 863 | if (typeof depth === 'number' && depth < 0) |
| 864 | return this; |
| 865 | |
| 866 | const constructor = getConstructorOf(this) || URL; |
| 867 | const obj = { __proto__: { constructor } }; |
| 868 | |
| 869 | obj.href = this.href; |
| 870 | obj.origin = this.origin; |
| 871 | obj.protocol = this.protocol; |
| 872 | obj.username = this.username; |
| 873 | obj.password = this.password; |
| 874 | obj.host = this.host; |
| 875 | obj.hostname = this.hostname; |
| 876 | obj.port = this.port; |
| 877 | obj.pathname = this.pathname; |
| 878 | obj.search = this.search; |
| 879 | obj.searchParams = this.searchParams; |
| 880 | obj.hash = this.hash; |
| 881 | |
| 882 | if (opts.showHidden) { |
| 883 | obj[contextForInspect] = this.#context; |
| 884 | } |
| 885 | |
| 886 | return `${constructor.name} ${inspect(obj, opts)}`; |
| 887 | } |
| 888 | |
| 889 | #getSearchFromContext() { |
| 890 | if (!this.#context.hasSearch) return ''; |
nothing calls this directly
no test coverage detected