(
input: ts.ClassDeclaration,
serializable: TypeSchema,
importer: (name: string, module: string) => void
)
| 314 | } |
| 315 | |
| 316 | export 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 | } |
no test coverage detected