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,8 +31,10 @@ export class ServerConfiguration<T extends { [key: string]: string }> {
|
||||
public getUrl(): string {
|
||||
let replacedUrl = this.url;
|
||||
for (const key in this.variableConfiguration) {
|
||||
var re = new RegExp("{" + key + "}","g");
|
||||
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
|
||||
if (this.variableConfiguration.hasOwnProperty(key)) {
|
||||
const re = new RegExp("{" + key + "}","g");
|
||||
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
|
||||
}
|
||||
}
|
||||
return replacedUrl;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user