Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
transformFile(fd: TFileDesc): TFileDesc[] {
const pathDetails = parse(fd.path);
const outputDir = this.genPath || pathDetails.dir;
const contractName = getFilenameWithoutAnyExtensions(pathDetails.name);
const abi = JSON.parse(fd.contents);
const relativeRuntimePath = getRelativeModulePath(outputDir, this.runtimePathAbs);
const types = abiToWrapper(abi, {
fileName: contractName,
relativeRuntimePath,
});
return [
{
path: join(outputDir, contractName + ".ts"),
contents: types,
},
];
}
}