{"version":3,"sources":["jsdelivr-header.js","/npm/yarn-audit-html@0.4.0/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;ACJA,MAAM,QAAU,QAAQ,aAClB,SAAW,QAAQ,kBACnB,IAAM,QAAQ,kBAEpB,QACK,QAAQ,IAAI,SACZ,OAAO,wBAAyB,eAChC,OAAO,mCAAoC,4BAC3C,OAAO,cAAe,kCAE3B,MAAM,UAAY,CAAC,EAAO,EAAS,kBAAmB,EAAU,GAAa,KACzE,IAAK,EAED,OADA,QAAQ,IAAI,WACL,QAAQ,KAAK,GAGxB,MAAM,EAAO,EAAM,MAAM,MAAM,QAAQ,GAAkB,KAAT,IAEhD,IAAI,EACJ,IACI,EAAO,EAAK,IAAI,KAAK,MACzB,CAAE,MAAO,GAEL,OADA,QAAQ,MAAM,mCACP,QAAQ,KAAK,EACxB,CAEA,MAAM,EAAe,GAAY,GAAG,mCAEpC,SAAS,EAAM,EAAc,EAAQ,GAChC,MAAK,KACF,QAAQ,IAAI,mCAAmC,KAC/C,QAAQ,KAAK,EAAE,IAElB,OAAO,IACJ,QAAQ,IAAI,sBACZ,QAAQ,MAAM,GACd,QAAQ,KAAK,EAAE,GACjB,EAGV,GAAI,QAAQ,MAAM,MACd,QAAQ,MAAM,QAAQ,UACnB,CACH,IAAI,EAAQ,GACZ,QAAQ,MAAM,GAAG,YAAY,WACzB,MAAM,EAAQ,KAAK,OAEL,OAAV,IACA,GAAS,EAEjB,IACA,QAAQ,MAAM,GAAG,OAAO,WACpB,QAAQ,MAAM,QAAQ,MAEtB,UAAU,EAAO,QAAQ,OAAQ,QAAQ,SAAU,QAAQ,OAC/D,GACJ","file":"/npm/yarn-audit-html@0.4.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/yarn-audit-html@0.4.0/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","#!/usr/bin/env node\n\nconst program = require('commander');\nconst reporter = require('./lib/reporter');\nconst pkg = require('./package.json');\n\nprogram\n    .version(pkg.version)\n    .option('-o, --output [output]', 'output file')\n    .option('-t, --template [handlebars file]', 'handlebars template file')\n    .option('--no-unique', 'show all vulnerability entries');\n\nconst genReport = (stdin, output = 'yarn-audit.html', template, showUnique = true) => {\n    if (!stdin) {\n        console.log('No JSON');\n        return process.exit(1);\n    }\n\n    const data = stdin.split(/\\n/).filter((line) => line !== '');\n\n    let json;\n    try {\n        json = data.map(JSON.parse);\n    } catch (err) {\n        console.error('Failed to parse NPM Audit JSON!');\n        return process.exit(1);\n    }\n\n    const templateFile = template || `${__dirname}/templates/template.hbs`;\n\n    reporter(json, templateFile, output, showUnique)\n        .then(() => {\n            console.log(`Vulnerability snapshot saved at ${output}`);\n            process.exit(0);\n        })\n        .catch((error) => {\n            console.log('An error occurred!');\n            console.error(error);\n            process.exit(1);\n        });\n};\n\nif (process.stdin.isTTY) {\n    program.parse(process.argv);\n} else {\n    let stdin = '';\n    process.stdin.on('readable', function () {\n        const chunk = this.read();\n\n        if (chunk !== null) {\n            stdin += chunk;\n        }\n    });\n    process.stdin.on('end', function () {\n        program.parse(process.argv);\n\n        genReport(stdin, program.output, program.template, program.unique);\n    });\n}\n"]}