{"version":3,"sources":["jsdelivr-header.js","/npm/async.util.asyncify@0.5.2/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aAEA,IAAI,SAAW,QAAQ,uBACnB,UAAY,QAAQ,wBAExB,OAAO,QAAU,SAAkB,GAC/B,OAAO,WAAU,SAAS,GACtB,IACI,EADA,EAAW,EAAK,MAEpB,IACI,EAAS,EAAK,MAAM,KAAM,EAC9B,CAAE,MAAO,GACL,OAAO,EAAS,EACpB,CAEI,SAAS,IAAkC,mBAAhB,EAAO,KAClC,EAAO,MAAK,SAAS,GACjB,EAAS,KAAM,EACnB,IAAU,OAAE,SAAS,GACjB,EAAS,EAAI,QAAU,EAAM,IAAI,MAAM,GAC3C,IAEA,EAAS,KAAM,EAEvB,GACJ","file":"/npm/async.util.asyncify@0.5.2/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/async.util.asyncify@0.5.2/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","'use strict';\n\nvar isObject = require('async.util.isobject');\nvar restParam = require('async.util.restparam');\n\nmodule.exports = function asyncify(func) {\n    return restParam(function(args) {\n        var callback = args.pop();\n        var result;\n        try {\n            result = func.apply(this, args);\n        } catch (e) {\n            return callback(e);\n        }\n        // if result is Promise object\n        if (isObject(result) && typeof result.then === \"function\") {\n            result.then(function(value) {\n                callback(null, value);\n            })[\"catch\"](function(err) {\n                callback(err.message ? err : new Error(err));\n            });\n        } else {\n            callback(null, result);\n        }\n    });\n};\n"]}