HEX
Server: Apache
System: Linux webd004.cluster130.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User: frenchy (106757)
PHP: 7.4.33
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/frenchy/www/french-american.org/current/node_modules/snyk/dist/lib/protect/dedupe-patches.js
"use strict";
module.exports = dedupe;
const debug = require('debug')('snyk:patch');
const patchesForPackage = require('./patches-for-package');
function dedupe(source) {
    const removed = [];
    const names = source.reduce((acc, vuln) => {
        if (Array.isArray(vuln.patches)) {
            // strip down to the only paches that can be applied
            vuln.patches = patchesForPackage(vuln);
        }
        const key = vuln.name + vuln.version + vuln.from.join('>');
        const other = acc[key];
        if (other) {
            debug('dupe found on %s & %s', vuln.id, other.id);
            if (vuln.publicationTime > other.publicationTime) {
                debug('stripping %s', other.id);
                removed.push(other);
                acc[key] = vuln;
            }
            else {
                removed.push(vuln);
            }
        }
        else {
            acc[key] = vuln;
        }
        return acc;
    }, {});
    // turn back into an array
    const packages = Object.keys(names).map((key) => {
        return names[key];
    });
    return {
        packages: packages,
        removed: removed,
    };
}
//# sourceMappingURL=dedupe-patches.js.map