src/utils/npm-audit-package.js
function getCustomSensitiveData(projectDir) {
    const sensitiveDataFile = pathJoin(projectDir, '.sensitivedata');
    const content = readFile(sensitiveDataFile).toString();
    const allPatterns = content
        .split(/\n|\r/)
        .map((line) => line.replace(/[\t]/g, ' '))
        .map((line) => line.trim())
        .filter((line) => line && line.length > 0)
        .filter((line) => !line.startsWith('#'));

    const sensitiveData = allPatterns.filter(
        (pattern) => !pattern.startsWith('!')
    );

    const ignoredData = allPatterns
        .filter((pattern) => pattern.startsWith('!'))
        .map((pattern) => pattern.replace('!', ''))
        .map((pattern) => pattern.trim());

    return {
        sensitiveData,
        ignoredData,
    };
}
function getCustomSensitiveData(projectDir) {
    const sensitiveDataFile = pathJoin(projectDir, '.sensitivedata');
    const content = readFile(sensitiveDataFile).toString();
    const allPatterns = content
        .split(/\n|\r/)
        .map((line) => line.replace(/[\t]/g, ' '))
        .map((line) => line.trim())
        .filter((line) => line && line.length > 0)
        .filter((line) => !line.startsWith('#'));

    const sensitiveData = allPatterns.filter(
        (pattern) => !pattern.startsWith('!')
    );

    const ignoredData = allPatterns
        .filter((pattern) => pattern.startsWith('!'))
        .map((pattern) => pattern.replace('!', ''))
        .map((pattern) => pattern.trim());

    return {
        sensitiveData,
        ignoredData,
    };
}
function getCustomSensitiveData ( projectDir ) { const sensitiveDataFile = pathJoin ( projectDir , '.sensitivedata' ) ; const content = readFile ( sensitiveDataFile ) . toString ( ) ; const allPatterns = content . split ( / \n|\r / ) . map ( ( line ) => line . replace ( / [\t] / g , ' ' ) ) . map ( ( line ) => line . trim ( ) ) . filter ( ( line ) => line && line . length > 0 ) . filter ( ( line ) => ! line . startsWith ( '#' ) ) ; const sensitiveData = allPatterns . filter ( ( pattern ) => ! pattern . startsWith ( '!' ) ) ; const ignoredData = allPatterns . filter ( ( pattern ) => pattern . startsWith ( '!' ) ) . map ( ( pattern ) => pattern . replace ( '!' , '' ) ) . map ( ( pattern ) => pattern . trim ( ) ) ; return { sensitiveData , ignoredData , } ; }
get all sensitive data from the '.sensitivedata' file
@param {string} projectDir - directory that contains a .sensitivedata file
@returns {DefaultSensitiveData}
get all sensitive data from the . sensitivedata file