chore: simplify variable (#1332)
This commit is contained in:
parent
132c9ee63f
commit
23f7f545ab
1 changed files with 1 additions and 3 deletions
|
@ -287,11 +287,9 @@ module.exports = {
|
|||
get URL() {
|
||||
/* istanbul ignore else */
|
||||
if (!this.memoizedURL) {
|
||||
const protocol = this.protocol;
|
||||
const host = this.host;
|
||||
const originalUrl = this.originalUrl || ''; // avoid undefined in template string
|
||||
try {
|
||||
this.memoizedURL = new URL(`${protocol}://${host}${originalUrl}`);
|
||||
this.memoizedURL = new URL(`${this.origin}${originalUrl}`);
|
||||
} catch (err) {
|
||||
this.memoizedURL = Object.create(null);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue