mirror of
https://github.com/dzeiocom/libs.git
synced 2025-04-23 19:32:14 +00:00
feat: Allow to remove the domain
Signed-off-by: Avior <f.bouillon@aptatio.com>
This commit is contained in:
parent
31ae6d8418
commit
d1d4169906
@ -167,19 +167,23 @@ export default class URLManager {
|
||||
|
||||
/**
|
||||
* set the url domain name
|
||||
* @param val the domain name
|
||||
* @param val the domain name (if set to null it will remove the domain)
|
||||
*/
|
||||
public domain(val: string): this
|
||||
public domain(val: string | null): this
|
||||
|
||||
/**
|
||||
* Manipulate the url domain
|
||||
* @param { string | undefined } val the url domain (Optionnal)
|
||||
* @param { string | null | undefined } val the url domain (Optionnal)
|
||||
* @return { string | this }
|
||||
*/
|
||||
public domain(val?: string) {
|
||||
if (!val) {
|
||||
public domain(val?: string | null) {
|
||||
if (typeof val === 'undefined') {
|
||||
return this._domain
|
||||
}
|
||||
if (!val) {
|
||||
delete this._domain
|
||||
return this
|
||||
}
|
||||
this._domain = val
|
||||
return this
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user