forked from loafle/openapi-generator-original
[typescript-rxjs] Update servers.mustache (#9449)
* Update servers.mustache add hasOwnProperty checking; use const instead of var * use 4 spaces instead of tabs
This commit is contained in:
parent
cc496ff2eb
commit
a33c353a26
@ -31,9 +31,11 @@ export class ServerConfiguration<T extends { [key: string]: string }> {
|
|||||||
public getUrl(): string {
|
public getUrl(): string {
|
||||||
let replacedUrl = this.url;
|
let replacedUrl = this.url;
|
||||||
for (const key in this.variableConfiguration) {
|
for (const key in this.variableConfiguration) {
|
||||||
var re = new RegExp("{" + key + "}","g");
|
if (this.variableConfiguration.hasOwnProperty(key)) {
|
||||||
|
const re = new RegExp("{" + key + "}","g");
|
||||||
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
|
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return replacedUrl;
|
return replacedUrl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user