Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeEach(() => {
alexa = VirtualAlexa.Builder()
.handler("hello-world/hello-world.alexaLambdaHandler") // Lambda function file and name
.interactionModelFile("hello-world/alexa-model.json")
.create();
});
private validateFilesAndBuild(createdEmptyInteractionModelIfNeeded: boolean): VirtualAlexa {
const builder = VirtualAlexa.Builder().applicationID(this.applicationID).skillURL(this.skillURL);
let usingInteractionModel = false;
if (this.locale) {
builder.locale(this.locale);
if (!this.interactionModelProvided) {
// If we don't have an interaction Model and have a locale, search in the default models/.json location
this.interactionModel = this.interactionModel.replace("en-US", this.locale);
}
}
if (!(this.interactionModelProvided || this.intentSchemaProvided)) {
// No model provided, we check if default files exists
if (fs.existsSync(this.interactionModel)) {
usingInteractionModel = true;
} else if (!(fs.existsSync(this.intentSchemaFile) && fs.existsSync(this.sampleUtterancesFile)) && !createdEmptyInteractionModelIfNeeded) {
// Model don't exist in default locations