Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async variable(key: string, def?: string): Promise {
let v: BakeVariable = this._find_variable(key) || new BakeVariable(def || "");
return await v.valueAsync(this.context);
}
public async regionVariable(key: string, def?: string, region?: IBakeRegion | null): Promise {
let rgn = region || this.context.Region
let rgn_code = rgn.shortName
//first try and resolve the variable by prepending the region code.
let rgn_key = rgn_code + "__" + key
let v: BakeVariable = this._find_variable(rgn_key) || this._find_variable(key) || new BakeVariable(def || "")
return await v.valueAsync(this.context);
}