Merge branch 'develop'
This commit is contained in:
@ -316,8 +316,10 @@ export class AiScript {
|
||||
|
||||
@autobind
|
||||
private interpolate(str: string, values: { name: string, value: any }[]) {
|
||||
return str.replace(/\{(.+?)\}/g, match =>
|
||||
(this.getVariableValue(match.slice(1, -1).trim(), values) || '').toString());
|
||||
return str.replace(/\{(.+?)\}/g, match => {
|
||||
const v = this.getVariableValue(match.slice(1, -1).trim(), values);
|
||||
return v == null ? 'NULL' : v.toString();
|
||||
});
|
||||
}
|
||||
|
||||
@autobind
|
||||
@ -445,7 +447,7 @@ export class AiScript {
|
||||
}
|
||||
|
||||
if (AiScript.envVarsDef[name]) {
|
||||
return this.envVars[name].value;
|
||||
return this.envVars[name];
|
||||
}
|
||||
|
||||
throw new Error(`Script: No such variable '${name}'`);
|
||||
|
@ -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();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
<i><fa icon="angle-right"/></i>
|
||||
</p>
|
||||
</li>
|
||||
<li @click="page">
|
||||
<li>
|
||||
<router-link to="/i/pages">
|
||||
<i><fa :icon="faStickyNote" fixed-width/></i>
|
||||
<span>{{ $t('@.pages') }}</span>
|
||||
|
Reference in New Issue
Block a user