MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / optionClass

Function optionClass

__tests__/explore-same-basename-pin.test.ts:49–67  ·  view source on GitHub ↗
(i: number)

Source from the content-addressed store, hash-verified

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 '',

Callers 1

registrySourceFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected