| 47 | '}', |
| 48 | ]; |
| 49 | const optionClass = (i: number) => { |
| 50 | L.push( |
| 51 | '', |
| 52 | `export class EditorOption${i} extends BaseEditorOption<number, string> {`, |
| 53 | ` private readonly allowed${i} = ['alpha${i}', 'beta${i}', 'gamma${i}'];`, |
| 54 | '', |
| 55 | ` constructor() {`, |
| 56 | ` super(${i}, 'option${i}', 'alpha${i}');`, |
| 57 | ' }', |
| 58 | '', |
| 59 | ' public validate(input: unknown): string {', |
| 60 | " if (typeof input !== 'string') {", |
| 61 | ' return this.defaultValue;', |
| 62 | ' }', |
| 63 | ` return this.allowed${i}.includes(input) ? input : this.defaultValue;`, |
| 64 | ' }', |
| 65 | '}', |
| 66 | ); |
| 67 | }; |
| 68 | for (let i = 0; i < 30; i++) optionClass(i); |
| 69 | L.push( |
| 70 | '', |