{"version":3,"sources":["jsdelivr-header.js","/Users/ramitos/dev/apr/packages/main/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gSCJA,IAAM,EAAS,SAAA,G,OACb,EAAE,OAAM,SAAA,G,QACE,MAAM,G,QACN,KAAK,E,YAqBA,SAAA,G,OAAM,EAAU,GAAK,EAAO,GAAK,EAAO,I","file":"/npm/apr-main@4.0.3/dist/apr-main.umd.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/apr-main@4.0.3/dist/apr-main.umd.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","const isPromise = require('is-promise');\n\nconst handle = p =>\n  p.catch(err => {\n    console.error(err);\n    process.exit(1);\n  });\n\n/**\n * <a id=\"main\"></a>\n * Catches a promise error, writes the stacktrace to stderr and exists\n *\n * [![](https://img.shields.io/npm/v/apr-main.svg?style=flat-square)](https://www.npmjs.com/package/apr-main) [![](https://img.shields.io/npm/l/apr-main.svg?style=flat-square)](https://www.npmjs.com/package/apr-main)\n *\n * @kind function\n * @name main\n * @param {Promise} input\n * @returns {Promise}\n *\n * @example\n * import main from 'apr-main';\n *\n * main(async () => 'hello') // writes nothing\n * main(async () => undefined) // writes nothing\n * main(async () => { throw new Error('uncaught error') }) // writes the stack trace to stderr and exists\n */\nmodule.exports = p => (isPromise(p) ? handle(p) : handle(p()));\n"]}