src/utils/npm-audit-package.js
function addSensitiveDataInfosIn(response) {
    const allSensitiveDataPatterns = getSensitiveData(process.cwd());
    const augmentedResponse = JSON.parse(JSON.stringify(response, null, 2));
    const files = augmentedResponse.files || [];
    files.forEach((file) => {
        if (file && isSensitiveData(file.path, allSensitiveDataPatterns)) {
            file.isSensitiveData = true;
            return;
        }

        if (file) {
            file.isSensitiveData = false;
        }
    });
    return augmentedResponse;
}
function addSensitiveDataInfosIn(response) {
    const allSensitiveDataPatterns = getSensitiveData(process.cwd());
    const augmentedResponse = JSON.parse(JSON.stringify(response, null, 2));
    const files = augmentedResponse.files || [];
    files.forEach((file) => {
        if (file && isSensitiveData(file.path, allSensitiveDataPatterns)) {
            file.isSensitiveData = true;
            return;
        }

        if (file) {
            file.isSensitiveData = false;
        }
    });
    return augmentedResponse;
}
function addSensitiveDataInfosIn ( response ) { const allSensitiveDataPatterns = getSensitiveData ( process . cwd ( ) ) ; const augmentedResponse = JSON . parse ( JSON . stringify ( response , null , 2 ) ) ; const files = augmentedResponse . files || [ ] ; files . forEach ( ( file ) => { if ( file && isSensitiveData ( file . path , allSensitiveDataPatterns ) ) { file . isSensitiveData = true ; return ; } if ( file ) { file . isSensitiveData = false ; } } ) ; return augmentedResponse ; }
Add sensitive data infos for each file included in the package
@param {Object} response - result of the npm pack command (eventually modified by previous middlewares execution)
@returns {Object} returns a new response object that is a deep copy of input response
with each file being tagged with a new boolean property 'isSensitiveData'.
Add sensitive data infos for each file included in the package