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A,iBACA,MACA,OACA,UACA,MACA,WACA,gBACA,UACA,QACA","file":"/npm/license-checker-rseidelsohn@4.4.2/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/license-checker-rseidelsohn@4.4.2/lib/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/*\nCopyright (c) 2013, Yahoo! Inc. All rights reserved.\nCode licensed under the BSD License:\nhttp://yuilibrary.com/license/\n*/\n\nconst LICENSE_TITLE_UNKNOWN = 'UNKNOWN';\nconst LICENSE_TITLE_UNLICENSED = 'UNLICENSED';\nconst INITIAL_MODULE_INFO = {\n    licenses: LICENSE_TITLE_UNKNOWN,\n};\n\nimport chalk from 'chalk';\nimport debug from 'debug';\nimport fs from 'node:fs';\nimport mkdirp from 'mkdirp';\nimport path from 'node:path';\nimport readInstalledPackages from 'read-installed-packages';\nimport spdxCorrect from 'spdx-correct';\nimport spdxSatisfies from 'spdx-satisfies';\nimport treeify from 'treeify';\nimport { createHash } from 'crypto';\nimport semver from 'semver';\n\nimport * as licenseCheckerHelpers from './licenseCheckerHelpers.js';\nimport { getLicenseTitle } from './getLicenseTitle.js';\nimport { licenseFiles } from './license-files.js';\nimport * as helpers from './indexHelpers.js';\n\n// Set up debug logging\n// https://www.npmjs.com/package/debug#stderr-vs-stdout\nconst debugError = debug('license-checker-rseidelsohn:error');\nconst debugLog = debug('license-checker-rseidelsohn:log');\n\ndebugLog.log = console.log.bind(console);\n\n// This function calls itself recursively. On the first iteration, it collects the data of the main program, during the\n// second iteration, it collects the data from all direct dependencies, then it collects their dependencies and so on.\nconst recursivelyCollectAllDependencies = (options) => {\n    const { color: colorize, deps: currentExtendedPackageJson, unknown } = options;\n    const moduleInfo = { ...INITIAL_MODULE_INFO };\n    const currentPackageNameAndVersion = `${currentExtendedPackageJson.name}@${currentExtendedPackageJson.version}`;\n\n    let { data } = options;\n    let licenseFilesInCurrentModuleDirectory = [];\n    let licenseData;\n    let licenseFile;\n    let noticeFiles = [];\n    const clarification = options.clarifications[currentExtendedPackageJson.name]?.find(\n        (clarification) =>\n            currentExtendedPackageJson.version === clarification.semverRange ||\n            semver.satisfies(currentExtendedPackageJson.version, clarification.semverRange),\n    );\n    let passedClarificationCheck = clarification?.checksum ? false : true;\n    if (clarification) {\n        clarification.used = true;\n    }\n\n    if (\n        // If we have processed this currentPackageNameAndVersion already, just return the data object.\n        // This was added so that we don't recurse forever if there was a circular\n        // dependency in the dependency tree.\n        data[currentPackageNameAndVersion] ||\n        (options.production && currentExtendedPackageJson.extraneous) ||\n        (options.development && !currentExtendedPackageJson.extraneous && !currentExtendedPackageJson.root)\n    ) {\n        return data;\n    }\n\n    if (currentExtendedPackageJson.private) {\n        moduleInfo.private = true;\n    }\n\n    data[currentPackageNameAndVersion] = moduleInfo;\n\n    // Include property in output unless custom format has set property explicitly to false:\n    const mustInclude = (propertyName = '') => options?.customFormat?.[propertyName] !== false;\n\n    if (mustInclude('repository')) {\n        const repositoryUrl = helpers.getRepositoryUrl({\n            clarificationRepository: clarification?.repository,\n            jsonRepository: currentExtendedPackageJson?.repository,\n        });\n\n        if (repositoryUrl) {\n            moduleInfo.repository = repositoryUrl;\n        }\n    }\n\n    if (mustInclude('url')) {\n        // TODO: Figure out where the check for currentExtendedPackageJson.url.web comes from. It's in the original license-checker,\n        //       but I can't find any documentation on it.\n        let url = helpers.getFirstNotUndefinedOrUndefined(clarification?.url, currentExtendedPackageJson?.url?.web);\n        /*istanbul ignore next*/\n        if (url) {\n            moduleInfo.url = url;\n        }\n    }\n\n    if (typeof currentExtendedPackageJson.author === 'object') {\n        const { publisher, email, url } = helpers.getAuthorDetails({\n            clarification,\n            author: currentExtendedPackageJson?.author,\n        });\n\n        if (mustInclude('publisher') && publisher) {\n            moduleInfo.publisher = publisher;\n        }\n\n        if (mustInclude('email') && email) {\n            moduleInfo.email = email;\n        }\n\n        // moduleInfo.url can for some reason already be set to currentExtendedPackageJson.url.web further up in the code,\n        // so we only set it if it's not already set.\n        if (typeof moduleInfo.url !== 'undefined' && mustInclude('url') && url) {\n            moduleInfo.url = url;\n        }\n    }\n\n    /*istanbul ignore next*/\n    if (unknown) {\n        moduleInfo.dependencyPath = currentExtendedPackageJson.path;\n    }\n\n    const modulePath = helpers.getFirstNotUndefinedOrUndefined(clarification?.path, currentExtendedPackageJson?.path);\n    if (mustInclude('path') && typeof modulePath === 'string') {\n        moduleInfo.path = modulePath;\n    }\n\n    // Eventually store the contents of the module's README.md in currentExtendedPackageJson.readme:\n    helpers.storeReadmeInJsonIfExists(modulePath, currentExtendedPackageJson);\n\n    // console.log('licenseData: %s', licenseData);\n\n    // Try to get the license information from the clarification file or from the package.json file:\n    licenseData = helpers.getFirstNotUndefinedOrUndefined(\n        clarification?.licenses,\n        currentExtendedPackageJson.license,\n        currentExtendedPackageJson.licenses,\n    );\n\n    if (licenseData) {\n        // License information has been collected from either the clarification file or from the package.json file\n        /*istanbul ignore else*/\n        if (Array.isArray(licenseData) && licenseData.length > 0) {\n            moduleInfo.licenses = licenseData.map((moduleLicense) => {\n                const moduleLicenseTypeOrName = helpers.getFirstNotUndefinedOrUndefined(\n                    moduleLicense.type,\n                    moduleLicense.name,\n                );\n\n                if (typeof moduleLicenseTypeOrName === 'string') {\n                    return moduleLicenseTypeOrName;\n                }\n\n                if (typeof moduleLicense === 'string') {\n                    return moduleLicense;\n                }\n            });\n        } else if (typeof helpers.getFirstNotUndefinedOrUndefined(licenseData.type, licenseData.name) === 'string') {\n            moduleInfo.licenses = getLicenseTitle(\n                helpers.getFirstNotUndefinedOrUndefined(licenseData.type, licenseData.name),\n            );\n        } else if (typeof licenseData === 'string') {\n            moduleInfo.licenses = getLicenseTitle(licenseData);\n        }\n    } else if (getLicenseTitle(currentExtendedPackageJson.readme)) {\n        // Try to get the license information from the README file if neither the clarification file nor the package.json\n        // file contained any license information:\n        moduleInfo.licenses = getLicenseTitle(currentExtendedPackageJson.readme);\n    }\n\n    if (Array.isArray(moduleInfo.licenses)) {\n        /*istanbul ignore else*/\n        if (moduleInfo.licenses.length === 1) {\n            moduleInfo.licenses = moduleInfo.licenses[0];\n        }\n    }\n\n    /*istanbul ignore else*/\n    if (clarification?.licenseFile) {\n        licenseFilesInCurrentModuleDirectory = [clarification.licenseFile];\n    } else if (fs.existsSync(modulePath)) {\n        const filesInModuleDirectory = fs.readdirSync(modulePath);\n        licenseFilesInCurrentModuleDirectory = licenseFiles(filesInModuleDirectory);\n\n        noticeFiles = filesInModuleDirectory.filter((filename) => {\n            filename = filename.toUpperCase();\n            const name = path.basename(filename).replace(path.extname(filename), '');\n\n            return name === 'NOTICE';\n        });\n    }\n\n    // console.log('licenseFilesInCurrentModuleDirectory before: %s', licenseFilesInCurrentModuleDirectory);\n\n    licenseFilesInCurrentModuleDirectory.forEach(function findBetterLicenseData(filename, index) {\n        licenseFile = path.join(modulePath, filename);\n        // Checking that the file is in fact a normal file and not a directory for example.\n        /*istanbul ignore else*/\n        if (fs.lstatSync(licenseFile).isFile()) {\n            let currentLicenceFilesContent;\n\n            if (\n                !moduleInfo.licenses ||\n                moduleInfo.licenses.indexOf(LICENSE_TITLE_UNKNOWN) > -1\n                // TODO: Should we override a custom license?\n                // || moduleInfo.licenses.indexOf('Custom:') === 0\n            ) {\n                //Only re-check the license if we didn't get it from elsewhere\n                currentLicenceFilesContent = fs.readFileSync(licenseFile, { encoding: 'utf8' });\n\n                moduleInfo.licenses = getLicenseTitle(currentLicenceFilesContent);\n            }\n\n            if (index === 0) {\n                // Treat the file with the highest precedence as licenseFile\n                if (clarification !== undefined && !passedClarificationCheck) {\n                    /*istanbul ignore else*/\n                    if (!currentLicenceFilesContent) {\n                        currentLicenceFilesContent = fs.readFileSync(licenseFile, { encoding: 'utf8' });\n                    }\n\n                    let sha256 = createHash('sha256').update(currentLicenceFilesContent).digest('hex');\n\n                    if (clarification.checksum !== sha256) {\n                        console.error(\n                            `Clarification checksum mismatch for ${currentPackageNameAndVersion} :(\\nFile checked: ${licenseFile}`,\n                        );\n                        process.exit(1);\n                    } else {\n                        passedClarificationCheck = true;\n                    }\n                }\n\n                /*istanbul ignore else*/\n                if (mustInclude('licenseFile')) {\n                    moduleInfo.licenseFile = helpers.getFirstNotUndefinedOrUndefined(\n                        clarification?.licenseFile,\n                        options.basePath ? path.relative(options.basePath, licenseFile) : licenseFile,\n                    );\n                }\n\n                if (mustInclude('licenseText') && options.customFormat) {\n                    if (clarification?.licenseText) {\n                        moduleInfo.licenseText = clarification.licenseText;\n                    } else {\n                        if (!currentLicenceFilesContent) {\n                            currentLicenceFilesContent = fs.readFileSync(licenseFile, { encoding: 'utf8' });\n                        }\n\n                        /*istanbul ignore else*/\n                        if (options._args && !options._args.csv) {\n                            moduleInfo.licenseText = currentLicenceFilesContent.trim();\n                        } else {\n                            moduleInfo.licenseText = currentLicenceFilesContent\n                                .replace(/\"/g, \"'\")\n                                .replace(/\\r?\\n|\\r/g, ' ')\n                                .trim();\n                        }\n                    }\n\n                    if (clarification?.licenseStart) {\n                        let startIndex = moduleInfo.licenseText.indexOf(clarification.licenseStart);\n                        let endIndex;\n\n                        if (clarification?.licenseEnd) {\n                            endIndex = moduleInfo.licenseText.indexOf(clarification.licenseEnd, startIndex);\n                        } else {\n                            endIndex = moduleInfo.licenseText.length;\n                        }\n\n                        moduleInfo.licenseText = moduleInfo.licenseText.substring(startIndex, endIndex);\n                    }\n                }\n\n                if (mustInclude('copyright') && options.customFormat) {\n                    if (clarification?.copyright) {\n                        moduleInfo.copyright = clarification.copyright;\n                    } else {\n                        if (!currentLicenceFilesContent) {\n                            currentLicenceFilesContent = fs.readFileSync(licenseFile, { encoding: 'utf8' });\n                        }\n\n                        const linesWithCopyright = helpers.getLinesWithCopyright(currentLicenceFilesContent);\n\n                        if (linesWithCopyright.length > 0) {\n                            moduleInfo.copyright = linesWithCopyright[0].replace(/\\n/g, '. ').trim();\n                        }\n\n                        // Mark files with multiple copyright statements. This might be\n                        // an indicator to take a closer look at the LICENSE file.\n                        if (linesWithCopyright.length > 1) {\n                            moduleInfo.copyright = `${moduleInfo.copyright}*`;\n                        }\n                    }\n                }\n            }\n        }\n    });\n\n    // console.log('moduleInfo.licenses after: %s', moduleInfo.licenses);\n\n    if (!passedClarificationCheck) {\n        console.error('All clarifications must come with a checksum');\n        process.exit(1);\n    }\n\n    // TODO: How do clarifications interact with notice files?\n    noticeFiles.forEach((filename) => {\n        const file = path.join(currentExtendedPackageJson.path, filename);\n        /*istanbul ignore else*/\n        if (fs.lstatSync(file).isFile()) {\n            moduleInfo.noticeFile = options.basePath ? path.relative(options.basePath, file) : file;\n        }\n    });\n\n    /*istanbul ignore else*/\n    if (currentExtendedPackageJson.dependencies) {\n        Object.keys(currentExtendedPackageJson.dependencies).forEach((dependencyName) => {\n            const childDependency =\n                options.currentRecursionDepth > options._args.direct\n                    ? {}\n                    : currentExtendedPackageJson.dependencies[dependencyName];\n            const dependencyId = `${childDependency.name}@${childDependency.version}`;\n\n            if (data[dependencyId]) {\n                // already exists\n                return;\n            }\n\n            data = recursivelyCollectAllDependencies({\n                _args: options._args,\n                basePath: options.basePath,\n                color: colorize,\n                customFormat: options.customFormat,\n                data,\n                deps: childDependency,\n                development: options.development,\n                production: options.production,\n                unknown,\n                currentRecursionDepth: options.currentRecursionDepth + 1,\n                clarifications: options.clarifications,\n            });\n        });\n    }\n\n    if (!currentExtendedPackageJson.name || !currentExtendedPackageJson.version) {\n        delete data[currentPackageNameAndVersion];\n    }\n\n    /*istanbul ignore next*/\n    if (options.customFormat) {\n        Object.keys(options.customFormat).forEach((customFormatKey) => {\n            if (mustInclude(customFormatKey) && moduleInfo[customFormatKey] === undefined) {\n                moduleInfo[customFormatKey] = helpers.getFirstNotUndefinedOrUndefined(\n                    clarification?.[customFormatKey],\n                    typeof currentExtendedPackageJson[customFormatKey] === 'string'\n                        ? currentExtendedPackageJson[customFormatKey]\n                        : options.customFormat[customFormatKey],\n                );\n            }\n        });\n    }\n\n    return data;\n};\n\nconst init = (args, callback) => {\n    debugLog('scanning %s', args.start);\n\n    // customPath is a path to a JSON file that defined a custom format\n    if (args.customPath) {\n        args.customFormat = parseJson(args.customPath);\n    }\n\n    const optionsForReadingInstalledPackages = {\n        depth: args.direct, // How deep to traverse the dependency tree\n        nopeer: args.nopeer, // Whether or not to skip peerDependencies in output\n        dev: true, // Whether or not to include devDependencies\n        log: debugLog, // A function to log debug info\n    };\n\n    if (args.production || args.development) {\n        optionsForReadingInstalledPackages.dev = false;\n    }\n\n    const toCheckforFailOn = [];\n    const toCheckforOnlyAllow = [];\n    let checker;\n    let pusher;\n\n    if (args.onlyAllow) {\n        checker = args.onlyAllow;\n        pusher = toCheckforOnlyAllow;\n    }\n\n    if (args.failOn) {\n        checker = args.failOn;\n        pusher = toCheckforFailOn;\n    }\n\n    // An object mapping from Package name -> list of what contents it should have, including a semver range for each entry\n    let clarifications = {};\n    if (args.clarificationsFile) {\n        const clarificationsFromFile = parseJson(args.clarificationsFile);\n\n        for (const [versionString, clarification] of Object.entries(clarificationsFromFile)) {\n            const versionSplit = versionString.lastIndexOf('@');\n            if (versionSplit !== -1) {\n                const name = versionString.slice(0, versionSplit);\n                const semverRange = versionString.slice(versionSplit + 1);\n                clarifications[name] = clarifications[name] || [];\n                // keep track for each clarification if it was used, optionally error when not\n                clarifications[name].push({ ...clarification, semverRange, used: false });\n            }\n        }\n    }\n\n    if (checker && pusher) {\n        checker.split(';').forEach((license) => {\n            license = license.trim();\n            /*istanbul ignore else*/\n            if (license.length > 0) {\n                pusher.push(license);\n            }\n        });\n    }\n\n    readInstalledPackages(args.start, optionsForReadingInstalledPackages, (err, installedPackagesJson) => {\n        // Good to know:\n        // The json object returned by readInstalledPackages stores all direct (prod and dev) dependencies from\n        // the package.json file in the property '_dependencies'. The property 'dependencies' contains all dependencies,\n        // including the ones that are only required by other dependencies.\n        if (optionsForReadingInstalledPackages.depth === 0) {\n            helpers.deleteNonDirectDependenciesFromAllDependencies(installedPackagesJson, args);\n        }\n\n        // 'allWantedDepthDependenciesWithVersions' might be longer than 'installedPackagesJson.dependencies', as it appends the version numbers to each key (package name),\n        // e.g. 'grunt@1' instead of 'grunt', and this way contains all different installed versions of each package:\n        let allWantedDepthDependenciesWithVersions = recursivelyCollectAllDependencies({\n            _args: args,\n            basePath: args.relativeLicensePath ? installedPackagesJson.path : null,\n            color: args.color,\n            customFormat: args.customFormat,\n            data: {},\n            deps: installedPackagesJson,\n            development: args.development,\n            production: args.production,\n            unknown: args.unknown,\n            currentRecursionDepth: 0,\n            clarifications,\n        });\n\n        if (args.clarificationsMatchAll) {\n            const unusedClarifications = [];\n            for (const [packageName, entries] of Object.entries(clarifications)) {\n                for (const clarification of entries) {\n                    if (!clarification.used) {\n                        unusedClarifications.push(`${packageName}@${clarification.semverRange}`);\n                    }\n                }\n            }\n            if (unusedClarifications.length) {\n                console.error(\n                    `Some clarifications (${unusedClarifications.join(\n                        ', ',\n                    )}) were unused and --clarificationsMatchAll was specified. Exiting.`,\n                );\n\n                process.exit(1);\n            }\n        }\n\n        const colorize = args.color;\n        const sorted = {}; // 'sorted' will store the same items as allWantedDepthDependenciesWithVersions, but sorted by package name and version\n        let resultJson = {};\n        const excludeLicenses =\n            args.excludeLicenses &&\n            args.excludeLicenses\n                .match(/([^\\\\\\][^,]|\\\\,)+/g)\n                .map((license) => license.replace(/\\\\,/g, ',').replace(/^\\s+|\\s+$/g, ''));\n        const includeLicenses =\n            args.includeLicenses &&\n            args.includeLicenses\n                .match(/([^\\\\\\][^,]|\\\\,)+/g)\n                .map((license) => license.replace(/\\\\,/g, ',').replace(/^\\s+|\\s+$/g, ''));\n        let inputError = null;\n\n        const colorizeString = (string) =>\n            /*istanbul ignore next*/\n            colorize ? chalk.bold.red(string) : string;\n\n        const filterDeletePrivatePackages = (privatePackage) => {\n            /*istanbul ignore next - I don't have access to private packages to test */\n            if (resultJson[privatePackage] && resultJson[privatePackage].private) {\n                delete resultJson[privatePackage];\n            }\n        };\n\n        const onlyIncludeWhitelist = (whitelist, filtered) => {\n            const resultJson = {};\n\n            Object.keys(filtered).map((filteredPackage) => {\n                // Whitelist packages by declaring:\n                // 1. the package full name. Ex: `react` (we suffix an '@' to ensure we don't match packages like `react-native`)\n                // 2. the package full name and the major version. Ex: `react@16`\n                // 3. the package full name and full version. Ex: `react@16.0.2`\n                if (\n                    whitelist.findIndex((whitelistPackage) =>\n                        filteredPackage.startsWith(\n                            whitelistPackage.lastIndexOf('@') > 0 ? whitelistPackage : `${whitelistPackage}@`,\n                        ),\n                    ) !== -1\n                ) {\n                    resultJson[filteredPackage] = filtered[filteredPackage];\n                }\n            });\n\n            return resultJson;\n        };\n\n        const excludeBlacklist = (blacklist, filtered) => {\n            const resultJson = {};\n\n            Object.keys(filtered).map((filteredPackage) => {\n                // Blacklist packages by declaring:\n                // 1. the package full name. Ex: `react` (we suffix an '@' to ensure we don't match packages like `react-native`)\n                // 2. the package full name and the major version. Ex: `react@16`\n                // 3. the package full name and full version. Ex: `react@16.0.2`\n                if (\n                    blacklist.findIndex((blacklistPackage) =>\n                        filteredPackage.startsWith(\n                            blacklistPackage.lastIndexOf('@') > 0 ? blacklistPackage : `${blacklistPackage}@`,\n                        ),\n                    ) === -1\n                ) {\n                    resultJson[filteredPackage] = filtered[filteredPackage];\n                }\n            });\n\n            return resultJson;\n        };\n\n        const excludePackagesStartingWith = (blacklist, currentResult) => {\n            const resultJson = { ...currentResult };\n\n            for (const pkgName in resultJson) {\n                for (const denyPrefix of blacklist) {\n                    if (pkgName.startsWith(denyPrefix)) delete resultJson[pkgName];\n                }\n            }\n\n            return resultJson;\n        };\n\n        const exitIfCheckHits = (packageName) => {\n            const currentLicense = resultJson[packageName]?.licenses;\n\n            if (currentLicense) {\n                checkForFailOn(currentLicense);\n                checkForOnlyAllow(currentLicense, packageName);\n            }\n        };\n\n        const checkForFailOn = (currentLicense) => {\n            if (!Array.isArray(toCheckforFailOn) || toCheckforFailOn.length === 0) {\n                return;\n            }\n\n            if (toCheckforFailOn.includes(currentLicense)) {\n                console.error(`Found license defined by the --failOn flag: \"${currentLicense}\". Exiting.`);\n\n                process.exit(1);\n            }\n        };\n\n        /**\n         * Check if the current license contains (eventually among others) at least one of the allowed licenses\n         *\n         * @param      {string}  currentLicense  The current license\n         * @param      {string}  packageName     The package name\n         */\n        const checkForOnlyAllow = (currentLicense, packageName) => {\n            if (toCheckforOnlyAllow.length > 0) {\n                let containsOneOfAllowedPackages = false;\n\n                for (const allowedLicense of toCheckforOnlyAllow) {\n                    // \"currentLicense\" is a longer string that may contain several license names,\n                    // and we check if one of those is a license listed in the \"toCheckforOnlyAllow\"\n                    // licenses array:\n                    if (currentLicense.includes(allowedLicense)) {\n                        containsOneOfAllowedPackages = true;\n                        break;\n                    }\n                }\n\n                if (!containsOneOfAllowedPackages) {\n                    console.error(\n                        `Package \"${packageName}\" is licensed under \"${currentLicense}\" which is not permitted by the --onlyAllow flag. Exiting.`,\n                    );\n\n                    process.exit(1);\n                }\n            }\n        };\n\n        const transformBSD = (spdx) =>\n            spdx === 'BSD' ? '(0BSD OR BSD-2-Clause OR BSD-3-Clause OR BSD-4-Clause)' : spdx;\n\n        const invertResultOf = (fn) => (spdx) => !fn(spdx);\n\n        const spdxIsValid = (spdx) => spdxCorrect(spdx) === spdx;\n\n        const getLicenseMatch = (licensesArr, filtered, packageName, packageData, compareLicenses) => {\n            const validSPDXLicenses = compareLicenses.map(transformBSD).filter(spdxIsValid);\n            const invalidSPDXLicenses = compareLicenses.map(transformBSD).filter(invertResultOf(spdxIsValid));\n            const spdxExcluder = `( ${validSPDXLicenses.join(' OR ')} )`;\n\n            let match = false;\n\n            licensesArr.forEach((license) => {\n                /*istanbul ignore if - just for protection*/\n                if (license.indexOf(LICENSE_TITLE_UNKNOWN) >= 0) {\n                    // Necessary due to colorization:\n                    filtered[packageName] = packageData;\n                } else {\n                    if (license.endsWith('*')) {\n                        license = license.slice(0, -1);\n                    }\n\n                    license = transformBSD(license);\n\n                    if (\n                        invalidSPDXLicenses.indexOf(license) >= 0 ||\n                        (spdxCorrect(license) &&\n                            validSPDXLicenses.length > 0 &&\n                            spdxSatisfies(spdxCorrect(license), spdxExcluder))\n                    ) {\n                        match = true;\n                    }\n                }\n            });\n\n            return match;\n        };\n\n        // This following block stores the licenses in the sorted object (before, the sorted object is the empty object):\n        Object.keys(allWantedDepthDependenciesWithVersions)\n            .sort()\n            .forEach((item) => {\n                if (allWantedDepthDependenciesWithVersions[item].private) {\n                    allWantedDepthDependenciesWithVersions[item].licenses = colorizeString(LICENSE_TITLE_UNLICENSED);\n                }\n\n                /*istanbul ignore next*/\n                if (!allWantedDepthDependenciesWithVersions[item].licenses) {\n                    allWantedDepthDependenciesWithVersions[item].licenses = colorizeString(LICENSE_TITLE_UNKNOWN);\n                }\n\n                if (\n                    args.unknown &&\n                    allWantedDepthDependenciesWithVersions[item].licenses &&\n                    allWantedDepthDependenciesWithVersions[item].licenses !== LICENSE_TITLE_UNKNOWN &&\n                    allWantedDepthDependenciesWithVersions[item].licenses.indexOf('*') > -1\n                ) {\n                    /*istanbul ignore if*/\n                    allWantedDepthDependenciesWithVersions[item].licenses = colorizeString(LICENSE_TITLE_UNKNOWN);\n                }\n                /*istanbul ignore else*/\n                if (allWantedDepthDependenciesWithVersions[item]) {\n                    if (args.relativeModulePath && allWantedDepthDependenciesWithVersions[item].path != null) {\n                        allWantedDepthDependenciesWithVersions[item].path = path.relative(\n                            args.start,\n                            allWantedDepthDependenciesWithVersions[item].path,\n                        );\n                    }\n\n                    if (args.onlyunknown) {\n                        if (\n                            allWantedDepthDependenciesWithVersions[item].licenses.indexOf('*') > -1 ||\n                            allWantedDepthDependenciesWithVersions[item].licenses.indexOf(LICENSE_TITLE_UNKNOWN) > -1\n                        ) {\n                            sorted[item] = allWantedDepthDependenciesWithVersions[item];\n                        }\n                    } else {\n                        sorted[item] = allWantedDepthDependenciesWithVersions[item];\n                    }\n                }\n            });\n\n        // 'allWantedDepthDependenciesWithVersions' is not needed anymore:\n        allWantedDepthDependenciesWithVersions = null;\n\n        if (!Object.keys(sorted).length) {\n            err = new Error('No packages found in this path...');\n        }\n\n        // This following block stores the entries from the 'sorted' object in the\n        // resultJson object (before, the resultJson object is the empty object):\n        if (\n            (!Array.isArray(excludeLicenses) || excludeLicenses.length === 0) &&\n            (!Array.isArray(includeLicenses) || includeLicenses.length === 0)\n        ) {\n            resultJson = { ...sorted };\n        } else {\n            if (Array.isArray(excludeLicenses) && excludeLicenses.length > 0) {\n                Object.entries(sorted).forEach(([packageName, packageData]) => {\n                    let { licenses } = packageData;\n\n                    /*istanbul ignore if - just for protection*/\n                    if (!licenses) {\n                        resultJson[packageName] = packageData;\n                    } else {\n                        const licensesArr = Array.isArray(licenses) ? licenses : [licenses];\n                        const licenseMatch = getLicenseMatch(\n                            licensesArr,\n                            resultJson,\n                            packageName,\n                            packageData,\n                            excludeLicenses,\n                        );\n\n                        if (!licenseMatch) {\n                            resultJson[packageName] = packageData;\n                        }\n                    }\n                });\n            }\n\n            if (Array.isArray(includeLicenses) && includeLicenses.length > 0) {\n                Object.entries(sorted).forEach(([packageName, packageData]) => {\n                    let { licenses } = packageData;\n\n                    /*istanbul ignore if - just for protection*/\n                    if (!licenses) {\n                        resultJson[packageName] = packageData;\n                    } else {\n                        const licensesArr = Array.isArray(licenses) ? licenses : [licenses];\n                        const licenseMatch = getLicenseMatch(\n                            licensesArr,\n                            resultJson,\n                            packageName,\n                            packageData,\n                            includeLicenses,\n                        );\n\n                        if (licenseMatch) {\n                            resultJson[packageName] = packageData;\n                        }\n                    }\n                });\n            }\n        }\n\n        // package whitelist\n        const whitelist = helpers.getOptionArray(args.includePackages);\n        if (whitelist) {\n            resultJson = onlyIncludeWhitelist(whitelist, resultJson);\n        }\n\n        // package blacklist\n        const blacklist = helpers.getOptionArray(args.excludePackages);\n        if (blacklist) {\n            resultJson = excludeBlacklist(blacklist, resultJson);\n        }\n\n        // exclude by package name starting with a string\n        const excludeStartStringsArr = helpers.getOptionArray(args.excludePackagesStartingWith);\n        if (excludeStartStringsArr) {\n            resultJson = excludePackagesStartingWith(excludeStartStringsArr, resultJson);\n        }\n\n        if (args.excludePrivatePackages) {\n            Object.keys(resultJson).forEach(filterDeletePrivatePackages);\n        }\n\n        Object.keys(resultJson).forEach(exitIfCheckHits);\n\n        /*istanbul ignore next*/\n        if (err) {\n            debugError(err);\n            inputError = err;\n        } else {\n            // Output to files, if necessary\n            writeOutput(args, resultJson);\n        }\n\n        // Return the callback and variables nicely\n        callback(inputError, resultJson);\n    });\n};\n\nconst filterAttributes = (attributes, json) => {\n    let filteredJson = json;\n\n    if (attributes) {\n        filteredJson = {};\n        attributes.forEach((attribute) => {\n            filteredJson[attribute] = json[attribute];\n        });\n    }\n\n    return filteredJson;\n};\n\nconst print = (sorted) => {\n    console.log(asTree(sorted));\n};\n\nconst asTree = (sorted) => treeify.asTree(sorted, true);\n\nconst asSummary = (sorted) => {\n    const licenseCountMap = new global.Map();\n    const licenseCountArray = [];\n    const sortedLicenseCountObj = {};\n\n    Object.values(sorted).forEach(({ licenses }) => {\n        /*istanbul ignore else*/\n        if (licenses) {\n            licenseCountMap.set(licenses, licenseCountMap.get(licenses) + 1 || 1);\n        }\n    });\n\n    licenseCountMap.forEach((count, license) => {\n        licenseCountArray.push({ license, count });\n    });\n\n    /*istanbul ignore next*/\n    licenseCountArray\n        .sort((a, b) => b.count - a.count)\n        .forEach(({ license, count }) => {\n            sortedLicenseCountObj[license] = count;\n        });\n\n    return treeify.asTree(sortedLicenseCountObj, true);\n};\n\nconst asCSV = (sorted, customFormat, csvComponentPrefix) => {\n    const csvHeaders = helpers.getCsvHeaders(customFormat, csvComponentPrefix);\n    const csvDataArr = helpers.getCsvData(sorted, customFormat, csvComponentPrefix);\n\n    return [csvHeaders, ...csvDataArr].join('\\n');\n};\n\n/**\n * Exports data as markdown (*.md) file which has it's own syntax.\n * @method\n * @param  {JSON} sorted       The sorted JSON data from all packages.\n * @param  {JSON} customFormat The custom format with information about the needed keys.\n * @return {String}            The returning plain text.\n */\nconst asMarkDown = (sorted, customFormat) => {\n    let text = [];\n\n    if (customFormat && Object.keys(customFormat).length > 0) {\n        Object.keys(sorted).forEach((sortedItem) => {\n            text.push(`- **[${sortedItem}](${sorted[sortedItem].repository})**`);\n\n            Object.keys(customFormat).forEach((customItem) => {\n                text.push(`    - ${customItem}: ${sorted[sortedItem][customItem]}`);\n            });\n        });\n    } else {\n        Object.keys(sorted).forEach((key) => {\n            const module = sorted[key];\n            text.push(`- [${key}](${module.repository}) - ${module.licenses}`);\n        });\n    }\n\n    return text.join('\\n');\n};\n\n/**\n * Output data in plain vertical format like Angular CLI does: https://angular.io/3rdpartylicenses.txt\n */\nconst asPlainVertical = (sorted) =>\n    Object.entries(sorted)\n        .map(([moduleName, moduleData]) => {\n            let licenseText = helpers.getModuleNameForLicenseTextHeader(moduleName);\n\n            if (Array.isArray(moduleData.licenses) && moduleData.licenses.length > 0) {\n                licenseText += moduleData.licenses.map((moduleLicense) => {\n                    /*istanbul ignore else*/\n                    if (typeof moduleLicense === 'object') {\n                        /*istanbul ignore next*/\n                        return moduleLicense.type || moduleLicense.name;\n                    }\n\n                    /*istanbul ignore next*/\n                    if (typeof moduleLicense === 'string') {\n                        return moduleLicense;\n                    }\n                });\n            } else if (\n                typeof moduleData.licenses === 'object' &&\n                (moduleData.licenses.type || moduleData.licenses.name)\n            ) {\n                licenseText += getLicenseTitle(moduleData.licenses.type || moduleData.licenses.name);\n            } else if (typeof moduleData.licenses === 'string') {\n                licenseText += getLicenseTitle(moduleData.licenses);\n            }\n\n            licenseText += '\\n';\n\n            if (Array.isArray(moduleData.licenseFile) && moduleData.licenseFile.length > 0) {\n                licenseText += moduleData.licenseFile.map((moduleLicense) => {\n                    /*istanbul ignore else*/\n                    if (typeof moduleLicense === 'object') {\n                        /*istanbul ignore next*/\n                        return moduleLicense.type || moduleLicense.name;\n                    }\n\n                    if (typeof moduleLicense === 'string') {\n                        return moduleLicense;\n                    }\n                });\n            } else if (\n                typeof moduleData.licenseFile === 'object' &&\n                (moduleData.licenseFile.type || moduleData.licenseFile.name)\n            ) {\n                licenseText += moduleData.licenseFile.type || moduleData.licenseFile.name;\n            } else if (typeof moduleData.licenseFile === 'string') {\n                licenseText += fs.readFileSync(moduleData.licenseFile, { encoding: 'utf8' });\n            }\n\n            return licenseText;\n        })\n        .join('\\n\\n');\n\nconst parseJson = (jsonPath) => {\n    if (typeof jsonPath !== 'string') {\n        return new Error('The path was not specified for the JSON file to parse.');\n    }\n\n    try {\n        const jsonFileContents = fs.readFileSync(jsonPath, { encoding: 'utf8' });\n\n        return JSON.parse(jsonFileContents);\n    } catch (err) {\n        return err;\n    }\n};\n\nconst asFiles = (json, outDir) => {\n    mkdirp.sync(outDir);\n\n    Object.keys(json).forEach((moduleName) => {\n        const licenseFile = json[moduleName].licenseFile;\n\n        if (licenseFile && fs.existsSync(licenseFile)) {\n            const fileContents = fs.readFileSync(licenseFile);\n            const outPath = path.join(outDir, `${moduleName}-LICENSE.txt`);\n            const baseDir = path.dirname(outPath);\n\n            mkdirp.sync(baseDir);\n            fs.writeFileSync(outPath, fileContents, 'utf8');\n        } else {\n            console.warn(`No license file found for module '${moduleName}'`);\n        }\n    });\n};\n\n/**\n * Write output to a file, if indicated in parsedArgs.\n */\nconst writeOutput = (parsedArgs, foundLicensesJson) => {\n    if (parsedArgs.files || parsedArgs.out) {\n        const formattedOutput = licenseCheckerHelpers.getFormattedOutput(foundLicensesJson, parsedArgs);\n\n        if (parsedArgs.files) {\n            asFiles(foundLicensesJson, parsedArgs.files);\n        }\n\n        if (parsedArgs.out) {\n            const dir = path.dirname(parsedArgs.out);\n\n            mkdirp.sync(dir);\n            fs.writeFileSync(parsedArgs.out, formattedOutput, 'utf8');\n        }\n    }\n};\n\nexport {\n    recursivelyCollectAllDependencies,\n    init,\n    filterAttributes,\n    print,\n    asTree,\n    asSummary,\n    asCSV,\n    asMarkDown,\n    asPlainVertical,\n    parseJson,\n    asFiles,\n    writeOutput,\n};\n"]}