src/utils/npm-audit-package.js
function updateSensitiveDataInfosOfIgnoredFilesIn(response, options) {
    const ignoredData = getIgnoredSensitiveData(options);
    const updatedResponse = JSON.parse(JSON.stringify(response, null, 2));
    const files = updatedResponse.files || [];
    files.forEach((file) => {
        if (
            file &&
            file.isSensitiveData &&
            isIgnoredData(file.path, ignoredData)
        ) {
            file.isSensitiveData = false;
            return;
        }
    });
    return updatedResponse;
}
function updateSensitiveDataInfosOfIgnoredFilesIn(response, options) {
    const ignoredData = getIgnoredSensitiveData(options);
    const updatedResponse = JSON.parse(JSON.stringify(response, null, 2));
    const files = updatedResponse.files || [];
    files.forEach((file) => {
        if (
            file &&
            file.isSensitiveData &&
            isIgnoredData(file.path, ignoredData)
        ) {
            file.isSensitiveData = false;
            return;
        }
    });
    return updatedResponse;
}
function updateSensitiveDataInfosOfIgnoredFilesIn ( response , options ) { const ignoredData = getIgnoredSensitiveData ( options ) ; const updatedResponse = JSON . parse ( JSON . stringify ( response , null , 2 ) ) ; const files = updatedResponse . files || [ ] ; files . forEach ( ( file ) => { if ( file && file . isSensitiveData && isIgnoredData ( file . path , ignoredData ) ) { file . isSensitiveData = false ; return ; } } ) ; return updatedResponse ; }
Update sensitive data infos for each ignored 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 ignored file being tagged with 'isSensitiveData=false'.
Update sensitive data infos for each ignored file included in the package