mirror of
https://github.com/pezkuwichain/pezkuwi-mobile-app.git
synced 2026-05-30 04:11:02 +00:00
1 line
2.9 KiB
Plaintext
1 line
2.9 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":[[2,2,1,0],[2,14,1,12],[4,2,2,0,"Object"],[4,8,2,6],[4,9,2,7,"defineProperty"],[4,23,2,21],[4,24,2,22,"exports"],[4,31,2,29],[4,33,2,31],[4,45,2,43],[4,47,2,45],[5,4,2,47,"value"],[5,9,2,52],[5,11,2,54],[6,2,2,59],[6,3,2,60],[6,4,2,61],[7,2,3,0,"exports"],[7,9,3,7],[7,10,3,8,"promisify"],[7,19,3,17],[7,22,3,20,"promisify"],[7,31,3,29],[8,2,4,0],[9,0,5,0],[10,0,6,0],[11,0,7,0],[12,0,8,0],[13,0,9,0],[14,0,10,0],[15,0,11,0],[16,0,12,0],[17,0,13,0],[18,0,14,0],[19,0,15,0],[20,0,16,0],[21,0,17,0],[22,0,18,0],[23,2,19,0],[23,11,19,9,"promisify"],[23,20,19,18,"promisify"],[23,21,19,19,"self"],[23,25,19,23],[23,27,19,25,"fn"],[23,29,19,27],[23,31,19,29],[23,34,19,32,"params"],[23,40,19,38],[23,42,19,40],[24,4,20,4],[24,11,20,11],[24,15,20,15,"Promise"],[24,22,20,22],[24,23,20,23],[24,24,20,24,"resolve"],[24,31,20,31],[24,33,20,33,"reject"],[24,39,20,39],[24,44,20,44],[25,6,21,8,"fn"],[25,8,21,10],[25,9,21,11,"apply"],[25,14,21,16],[25,15,21,17,"self"],[25,19,21,21],[25,21,21,23,"params"],[25,27,21,29],[25,28,21,30,"concat"],[25,34,21,36],[25,35,21,37],[25,36,21,38,"error"],[25,41,21,43],[25,43,21,45,"result"],[25,49,21,51],[25,54,21,56],[26,8,22,12],[26,12,22,16,"error"],[26,17,22,21],[26,19,22,23],[27,10,23,16,"reject"],[27,16,23,22],[27,17,23,23,"error"],[27,22,23,28],[27,23,23,29],[28,8,24,12],[28,9,24,13],[28,15,25,17],[29,10,26,16,"resolve"],[29,17,26,23],[29,18,26,24,"result"],[29,24,26,30],[29,25,26,31],[30,8,27,12],[31,6,28,8],[31,7,28,9],[31,8,28,10],[31,9,28,11],[32,4,29,4],[32,5,29,5],[32,6,29,6],[33,2,30,0],[34,0,30,1],[34,3]],"functionMap":{"names":["<global>","promisify","Promise$argument_0","params.concat$argument_0"],"mappings":"AAA;ACkB;uBCC;qCCC;SDO;KDC;CDC"},"hasCjsExports":true},"type":"js/module"}]} |