{"version":3,"sources":["jsdelivr-header.js","/npm/node-sri@1.1.1/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,IAAI,KAAO,QAAQ,iBAAiB,KASpC,SAAS,KAAK,EAAM,GAClB,IAAI,EAAU,CACZ,KAAM,SACN,QAAQ,GAGV,GAAoB,iBAAT,EACT,IAAK,IAAI,KAAQ,EAAQ,EAAQ,GAAQ,EAAK,QAE9C,EAAQ,KAAO,EAGjB,IAAI,EAAI,IAAI,SAAQ,SAAS,EAAS,GACpC,KAAK,OAAS,EAAQ,KAAO,oBAAsB,EAAQ,KAAO,qCAAqC,SAAU,EAAO,EAAQ,GACxH,GAAoB,KAAX,EACX,EAAO,GAAS,GAEhB,EAAQ,EAAQ,OAAS,EAAQ,KAAO,IAAM,EAAS,EAE7D,GACF,IAEA,GAAkB,mBAAP,EAOT,OAAO,EANP,EAAE,MAAK,SAAS,GACd,EAAG,KAAM,EACX,IAAG,OAAM,SAAS,GAChB,EAAG,IAAI,MAAM,QAAM,EACrB,GAIJ,CAOA,OAAO,QAAU,CACf,KAAM","file":"/npm/node-sri@1.1.1/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/node-sri@1.1.1/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","var exec = require('child_process').exec;\n\n/**\n * Creates a SRI hash of the given file\n *\n * @param  {Mixed}   file Accepts either a filename or a dictionary of options\n * @param  {Function} cb   optional\n * @return {Mixed}    Returns a promise if no callback was provided\n */\nfunction hash(file, cb) {\n  var options = {\n    algo: 'sha256',\n    prefix: true\n  }\n\n  if (typeof file === 'object') {\n    for (var prop in file) { options[prop] = file[prop]; }\n  } else {\n    options.file = file\n  }\n\n  var p = new Promise(function(resolve, reject){\n    exec('cat ' + options.file + ' | openssl dgst -' + options.algo + ' -binary | openssl enc -base64 -A', function (error, stdout, stderr) {\n        if (error || stderr !== '') {\n          reject(error || stderr)\n        } else {\n          resolve(options.prefix ? options.algo + '-' + stdout : stdout)\n        }\n    });\n  })\n\n  if (typeof cb === 'function') {\n    p.then(function(hash){\n      cb(null, hash)\n    }).catch(function(err){\n      cb(new Error(err), undefined)\n    })\n  } else {\n    return p\n  }\n}\n\n/**\n * Public API\n *\n * @type {Object}\n */\nmodule.exports = {\n  hash: hash\n}\n"]}