MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / emitWithIndex

Function emitWithIndex

packages/alphatab/scripts/JsonDeclarationEmitter.ts:217–240  ·  view source on GitHub ↗
(program: ts.Program, _diagnostics: ts.Diagnostic[])

Source from the content-addressed store, hash-verified

215 return sourceFile;
216});
217export default function emitWithIndex(program: ts.Program, _diagnostics: ts.Diagnostic[]) {
218 allJsonTypes = new Map<string, string>();
219
220 emit(program, _diagnostics);
221
222 const statements = Array.from(allJsonTypes.entries()).map(type =>
223 ts.factory.createExportDeclaration(
224 undefined,
225 true,
226 ts.factory.createNamedExports([
227 ts.factory.createExportSpecifier(false, undefined, ts.factory.createIdentifier(type[0]))
228 ]),
229 ts.factory.createStringLiteral(type[1])
230 )
231 );
232
233 const sourceFile = ts.factory.createSourceFile(
234 [...statements],
235 ts.factory.createToken(ts.SyntaxKind.EndOfFileToken),
236 ts.NodeFlags.None
237 );
238
239 generateFile(program, sourceFile, '_jsonbarrel.ts');
240}

Callers

nothing calls this directly

Calls 4

generateFileFunction · 0.90
fromMethod · 0.80
mapMethod · 0.45
entriesMethod · 0.45

Tested by

no test coverage detected