mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-05-30 18:01:02 +00:00
1 line
2.7 KiB
Plaintext
1 line
2.7 KiB
Plaintext
{"dependencies":[],"output":[{"data":{"code":"__d(function (global, require, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {\n \"use strict\";\n\n Object.defineProperty(exports, '__esModule', {\n value: true\n });\n exports.promisify = promisify;\n /**\n * @name promisify\n * @summary Wraps an async callback into a `Promise`\n * @description\n * Wraps the supplied async function `fn` that has a standard JS callback `(error: Error, result: any)` into a `Promise`, passing the supplied parameters. When `error` is set, the Promise is rejected, else the Promise resolves with the `result` value.\n * @example\n * <BR>\n *\n * ```javascript\n * const { promisify } from '@polkadot/util';\n *\n * await promisify(null, ((a, cb) => cb(null, a), true); // resolves with `true`\n * await promisify(null, (cb) => cb(new Error('error!'))); // rejects with `error!`\n * ```\n */\n function promisify(self, fn, ...params) {\n return new Promise((resolve, reject) => {\n fn.apply(self, params.concat((error, result) => {\n if (error) {\n reject(error);\n } else {\n resolve(result);\n }\n }));\n });\n }\n});","lineCount":34,"map":[[7,2,16,0,"exports"],[7,9,16,0],[7,10,16,0,"promisify"],[7,19,16,0],[7,22,16,0,"promisify"],[7,31,16,0],[8,2,1,0],[9,0,2,0],[10,0,3,0],[11,0,4,0],[12,0,5,0],[13,0,6,0],[14,0,7,0],[15,0,8,0],[16,0,9,0],[17,0,10,0],[18,0,11,0],[19,0,12,0],[20,0,13,0],[21,0,14,0],[22,0,15,0],[23,2,16,7],[23,11,16,16,"promisify"],[23,20,16,25,"promisify"],[23,21,16,26,"self"],[23,25,16,30],[23,27,16,32,"fn"],[23,29,16,34],[23,31,16,36],[23,34,16,39,"params"],[23,40,16,45],[23,42,16,47],[24,4,17,4],[24,11,17,11],[24,15,17,15,"Promise"],[24,22,17,22],[24,23,17,23],[24,24,17,24,"resolve"],[24,31,17,31],[24,33,17,33,"reject"],[24,39,17,39],[24,44,17,44],[25,6,18,8,"fn"],[25,8,18,10],[25,9,18,11,"apply"],[25,14,18,16],[25,15,18,17,"self"],[25,19,18,21],[25,21,18,23,"params"],[25,27,18,29],[25,28,18,30,"concat"],[25,34,18,36],[25,35,18,37],[25,36,18,38,"error"],[25,41,18,43],[25,43,18,45,"result"],[25,49,18,51],[25,54,18,56],[26,8,19,12],[26,12,19,16,"error"],[26,17,19,21],[26,19,19,23],[27,10,20,16,"reject"],[27,16,20,22],[27,17,20,23,"error"],[27,22,20,28],[27,23,20,29],[28,8,21,12],[28,9,21,13],[28,15,22,17],[29,10,23,16,"resolve"],[29,17,23,23],[29,18,23,24,"result"],[29,24,23,30],[29,25,23,31],[30,8,24,12],[31,6,25,8],[31,7,25,9],[31,8,25,10],[31,9,25,11],[32,4,26,4],[32,5,26,5],[32,6,26,6],[33,2,27,0],[34,0,27,1],[34,3]],"functionMap":{"names":["<global>","promisify","Promise$argument_0","params.concat$argument_0"],"mappings":"AAA;OCe;uBCC;qCCC;SDO;KDC;CDC"},"hasCjsExports":false},"type":"js/module"}]} |