mirror of
https://github.com/dzeiocom/libs.git
synced 2025-04-23 03:12:12 +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
|
* 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
|
* Manipulate the url domain
|
||||||
* @param { string | undefined } val the url domain (Optionnal)
|
* @param { string | null | undefined } val the url domain (Optionnal)
|
||||||
* @return { string | this }
|
* @return { string | this }
|
||||||
*/
|
*/
|
||||||
public domain(val?: string) {
|
public domain(val?: string | null) {
|
||||||
if (!val) {
|
if (typeof val === 'undefined') {
|
||||||
return this._domain
|
return this._domain
|
||||||
}
|
}
|
||||||
|
if (!val) {
|
||||||
|
delete this._domain
|
||||||
|
return this
|
||||||
|
}
|
||||||
this._domain = val
|
this._domain = val
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user