Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise((resolve: (stdOut: string) => void, reject: (error: any) => void) => {
const [config, platform] = filterContent(compileOptions);
const instance = new compiler(config);
const firstSupportedPlatform = getFirstSupportedPlatform(orderPlatforms(platform));
if (firstSupportedPlatform !== Platform.JAVA) {
// TODO(KB): Provide feedback on this API. It's a little strange to nullify the JAR_PATH
// and provide a fake java path.
instance.JAR_PATH = null;
instance.javaPath = getNativeImagePath();
}
instance.run(async (exitCode: number, code: string, stdErr: string) => {
if (
'warning_level' in compileOptions &&
compileOptions.warning_level === 'VERBOSE' &&
stdErr !== ''
) {
reject(new Error(`Google Closure Compiler ${stdErr}`));
} else if (exitCode !== 0) {