Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
entrySrc.statements.forEach(s => {
if (
s.kind === NodeKind.CLASSDECLARATION &&
s.decorators &&
s.decorators.length &&
s.decorators.some(d => d.name.text === "deserializable")
) {
const name = s.name.text
const marshalCode = buildMarshal(name, deserializableClasses[name])
console.log(marshalCode)
const marshalStmt = parseStatements(entrySrc, marshalCode)[0]
const method = Node.createMethodDeclaration(
marshalStmt.name,
null,
marshalStmt.signature,
marshalStmt.body,
null,
CommonFlags.STATIC,
entrySrc.range // TODO
)
// s.members.push(method)
entrySrc.statements.push(marshalStmt)
}
})