Add abstract getter & setters for the redirect value.
This commit is contained in:
parent
a4b12334c5
commit
e2d233f8d6
|
@ -33,4 +33,8 @@ export abstract class Redirect<P extends RedirectParameters> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract redirect(url: URL | string): URL;
|
public abstract redirect(url: URL | string): URL;
|
||||||
|
|
||||||
|
public abstract get redirectValue(): string;
|
||||||
|
|
||||||
|
public abstract set redirectValue(value: string);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,4 +11,12 @@ export class HostnameRedirect extends Redirect<HostnameParameters> {
|
||||||
redirected.hostname = this.parameters.hostname;
|
redirected.hostname = this.parameters.hostname;
|
||||||
return redirected;
|
return redirected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get redirectValue(): string {
|
||||||
|
return this.parameters.hostname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set redirectValue(value: string) {
|
||||||
|
this.parameters.hostname = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,4 +9,12 @@ export class SimpleRedirect extends Redirect<SimpleParameters> {
|
||||||
public redirect(): URL {
|
public redirect(): URL {
|
||||||
return new URL(this.parameters.target);
|
return new URL(this.parameters.target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get redirectValue(): string {
|
||||||
|
return this.parameters.target;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set redirectValue(value: string) {
|
||||||
|
this.parameters.target = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue