Merge branch 'develop'

This commit is contained in:
syuilo 2019-04-29 11:11:17 +09:00
commit 8836bd4f3b
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
5 changed files with 17 additions and 7 deletions

View file

@ -38,8 +38,10 @@ class Script {
}
public interpolate(str: string) {
return str.replace(/\{(.+?)\}/g, match =>
(this.vars.find(x => x.name === match.slice(1, -1).trim()).value || '').toString());
return str.replace(/\{(.+?)\}/g, match => {
const v = this.vars.find(x => x.name === match.slice(1, -1).trim()).value;
return v == null ? 'NULL' : v.toString();
});
}
}