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

Function createToJsonMethod

packages/alphatab/scripts/Serializer.toJson.ts:316–329  ·  view source on GitHub ↗
(
    input: ts.ClassDeclaration,
    serializable: TypeSchema,
    importer: (name: string, module: string) => void
)

Source from the content-addressed store, hash-verified

314}
315
316export function createToJsonMethod(
317 input: ts.ClassDeclaration,
318 serializable: TypeSchema,
319 importer: (name: string, module: string) => void
320) {
321 const methodDecl = createNodeFromSource<ts.MethodDeclaration>(
322 `public class Serializer {
323 public static toJson(obj: ${input.name!.text} | null): Map<string, unknown> | null {
324 }
325 }`,
326 ts.SyntaxKind.MethodDeclaration
327 );
328 return setMethodBody(methodDecl, generateToJsonBody(serializable, importer));
329}

Callers 1

Calls 3

createNodeFromSourceFunction · 0.90
setMethodBodyFunction · 0.90
generateToJsonBodyFunction · 0.85

Tested by

no test coverage detected