Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const validateApp = (compiledApp) => {
const cleanedApp = cleaner.recurseCleanFuncs(compiledApp);
const results = zapierSchema.validateAppDefinition(cleanedApp);
// Check for style guide only if there are no schema errors
if (results.errors.length === 0) {
// These aren't ValidationError so it won't "stop" validation, but it will show them in `zapier validate`
const styleGuideResults = styleGuideChecker.validateAppDefinition(cleanedApp);
return dataTools.jsonCopy(styleGuideResults.errors);
}
return dataTools.jsonCopy(results.errors);
};