Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function generateError(source, { errorInfo, messageArgs } = {}) {
const message = generateErrorMessage(errorInfo, messageArgs);
const error = source.buildCodeFrameError(message);
error.filename = normalizeFilename(source);
error.loc = normalizeLocation(source);
error.lwcCode = errorInfo && errorInfo.code;
return error;
}
function generateError(path, { errorInfo, messageArgs } = {}) {
const message = generateErrorMessage(errorInfo, messageArgs);
const error = path.buildCodeFrameError(message);
error.lwcCode = errorInfo.code;
return error;
}