src/utils/npm-audit-package.js
function getIgnoredSensitiveData(options) {
    try {
        const sensitiveDataIgnoreFile = pathJoin(
            options.directoryToPackage,
            '.publishrc'
        );
        const publishPleaseConfiguration = JSON.parse(
            readFile(sensitiveDataIgnoreFile).toString()
        );
        const result =
            publishPleaseConfiguration &&
            publishPleaseConfiguration.validations &&
            publishPleaseConfiguration.validations.sensitiveData &&
            Array.isArray(
                publishPleaseConfiguration.validations.sensitiveData.ignore
            )
                ? publishPleaseConfiguration.validations.sensitiveData.ignore
                : [];
        return result;
    } catch (error) {
        return [];
    }
}
function getIgnoredSensitiveData(options) {
    try {
        const sensitiveDataIgnoreFile = pathJoin(
            options.directoryToPackage,
            '.publishrc'
        );
        const publishPleaseConfiguration = JSON.parse(
            readFile(sensitiveDataIgnoreFile).toString()
        );
        const result =
            publishPleaseConfiguration &&
            publishPleaseConfiguration.validations &&
            publishPleaseConfiguration.validations.sensitiveData &&
            Array.isArray(
                publishPleaseConfiguration.validations.sensitiveData.ignore
            )
                ? publishPleaseConfiguration.validations.sensitiveData.ignore
                : [];
        return result;
    } catch (error) {
        return [];
    }
}
function getIgnoredSensitiveData ( options ) { try { const sensitiveDataIgnoreFile = pathJoin ( options . directoryToPackage , '.publishrc' ) ; const publishPleaseConfiguration = JSON . parse ( readFile ( sensitiveDataIgnoreFile ) . toString ( ) ) ; const result = publishPleaseConfiguration && publishPleaseConfiguration . validations && publishPleaseConfiguration . validations . sensitiveData && Array . isArray ( publishPleaseConfiguration . validations . sensitiveData . ignore ) ? publishPleaseConfiguration . validations . sensitiveData . ignore : [ ] ; return result ; } catch ( error ) { return [ ] ; } }
Get files, in .publishrc configuration file, that should be ignored within the npm package
@param {DefaultOptions} options
@returns {[string]} returns the list of files that should be ignored
Get files in . publishrc configuration file that should be ignored within the npm package