UNPKG

ask-cli

Version:

Alexa Skills Kit (ASK) Command Line Interfaces

34 lines (33 loc) 973 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SampleTemplatesFilter = void 0; /** * * Class representing a generic array of skill sample templates, which allows filtering of samples based on user input * * { "templates": [] } * */ class SampleTemplatesFilter { constructor(samples) { this.templates = samples; } /** * Filters unneeded sample templates from the sampleTemplates list * * @param key SampleTemplate key to filter * @param value value of the key to filter. Must be one of types SampleTemplateFilterValues */ filter(key, value) { this.templates = this.templates.filter((sample) => sample[key] === value); } /** * The remaining SampleTemplates * * @returns Array of SampleTemplate that have not been filtered */ getSampleTemplates() { return this.templates; } } exports.SampleTemplatesFilter = SampleTemplatesFilter;