preferred-node-version
Version:
Get the preferred Node.js version of a project or user
14 lines (11 loc) • 328 B
JavaScript
export const getError=(error,filePath,envVariable)=>{
const errorPrefix=getErrorPrefix(filePath,envVariable);
error.message=`In ${errorPrefix}: ${error.message}`;
return error
};
const getErrorPrefix=(filePath,envVariable)=>{
if(filePath!==undefined){
return`file ${filePath}`
}
return`environment variable ${envVariable}`
};