src/utils/npm-audit.js
function processResult(result) {
    return {
        whenErrorIs: (errorCode) => {
            if (
                errorCode === EAUDITNOLOCK &&
                packageLockHasNotBeenFound(result)
            ) {
                const summary = result.error.summary || '';
                result.error.summary = `package.json file is missing or is badly formatted. ${summary}`;
                return result;
            }
            return result;
        },
    };
}
function processResult(result) {
    return {
        whenErrorIs: (errorCode) => {
            if (
                errorCode === EAUDITNOLOCK &&
                packageLockHasNotBeenFound(result)
            ) {
                const summary = result.error.summary || '';
                result.error.summary = `package.json file is missing or is badly formatted. ${summary}`;
                return result;
            }
            return result;
        },
    };
}
function processResult ( result ) { return { whenErrorIs : ( errorCode ) => { if ( errorCode === EAUDITNOLOCK && packageLockHasNotBeenFound ( result ) ) { const summary = result . error . summary || '' ; result . error . summary = ` ${ summary } ` ; return result ; } return result ; } , } ; }
Middleware that intercept any input error object.
This middleware may modify the inital error message
@param {Object} result -  result of the npm audit command
Middleware that intercept any input error object . This middleware may modify the inital error message