Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(opts => {
opts.fileSystem["main.ts"] = ' ';
opts.fileSystem["custom.ts"] = js;
opts.fileSystem["pxt-core.d.ts"] = common;
opts.fileSystem["pxt-helpers.ts"] = helpers;
opts.ast = true;
opts.testMode = true;
opts.ignoreFileResolutionErrors = true;
var resp = pxtc.compile(opts);
if (!resp.success) {
console.log('error: ', resp);
return;
}
var file = resp.ast.getSourceFile("main.ts");
var apiInfo = pxtc.getApiInfo(opts, resp.ast);
var blockInfo = pxtc.getBlocksInfo(apiInfo);
// Initialize blocks in Blockly