UNPKG

2.5 kBSource Map (JSON)View Raw
1{"version":3,"file":"whenx.min.js","sources":["src/thenx.js","src/whenx.js","src/main.js"],"sourcesContent":["\nconst thenx= (name, opts= {})=>{\n // console.info(`func: ${name}`)\n return new Promise((resolve, reject)=>{\n const method= wx[name]( Object.assign(opts, {\n success: res=> resolve(res)\n ,fail: err=> reject(err)\n ,complete: opts.complete\n }) )\n if(opts.progress){\n if(typeof opts.progress== \"function\"){\n let task= method\n Function.call(opts.progress, task)\n }\n else console.warn(`[whenx]progress must be a function to call with task but not: ${typeof(opts.progress)}`)\n }\n })\n}\n\n/**\n * @desc\n * @module Function\n * @param {string} name\n * @param {object} opts\n * @return {promise}\n */\nmodule.exports= thenx\n","\nconst thenx= require('./thenx')\n\nconst whenx= function(){\n let _wx= {}\n for(let k in wx){\n if(typeof wx[k] === 'function'){\n // console.info(`func: ${k}`)\n _wx[k]= (v)=> thenx.call(this, k, v)\n }\n }\n return _wx\n}()\n\n/**\n * @desc\n * @module Object\n * @return {bject}\n */\nmodule.exports= whenx\n","\nimport {version} from '../package.json'\n\nimport * as whenx from './whenx'\nimport * as thenx from './thenx'\n\nlet main= whenx\n// console.info(main)\nmain.whenx= whenx\nmain.thenx= thenx\nmain.version= version\n\n/**\n * @desc\n * @module Object\n * @return {object}\n * @member {function} whenx\n * @member {function} thenx\n */\nexport default main\n"],"names":["name","opts","Promise","resolve","reject","method","wx","Object","assign","success","res","fail","err","complete","progress","Function","call","console","warn","whenx","_wx","k","v","thenx","main","version"],"mappings":";;;;6BACa,CAACA,CAAD,CAAOC,EAAM,EAAb,GAEJ,GAAIC,QAAJ,CAAY,CAACC,CAAD,CAAUC,CAAV,GAAmB,CACpC,KAAMC,GAAQC,GAAGN,CAAH,EAAUO,OAAOC,MAAP,CAAcP,CAAd,CAAoB,CAC1CQ,QAASC,GAAMP,EAAQO,CAAR,CAD2B,CAEzCC,KAAMC,GAAMR,EAAOQ,CAAP,CAF6B,CAGzCC,SAAUZ,EAAKY,QAH0B,CAApB,CAAV,CAAd,CAKA,GAAGZ,EAAKa,QAAR,CACE,GAA0B,UAAvB,QAAOb,GAAKa,QAAf,CAAqC,CAEnCC,SAASC,IAAT,CAAcf,EAAKa,QAAnB,CADUT,CACV,CACD,CAHD,IAIKY,SAAQC,IAAR,CAAc,iEAAgE,MAAOjB,GAAKa,QAAU,EAApG,CAER,CAbM,ECAT,KAAMK,GAAO,UAAU,CACrB,GAAIC,GAAK,EAAT,CACA,IAAI,GAAIC,EAAR,GAAaf,GAAb,CACsB,UAAjB,QAAOA,IAAGe,CAAH,CADZ,GAGID,EAAIC,CAAJ,EAASC,CAAD,EAAMC,EAAMP,IAANO,CAAW,IAAXA,CAAiBF,CAAjBE,CAAoBD,CAApBC,CAHlB,EAMA,MAAOH,EACR,CATY,EAAb,OAgBgBD,kCCbhB,GAAIK,GAAML,CAAV,OAEAK,GAAKL,KAALK,CAAYL,EACZK,EAAKD,KAALC,+BACAA,EAAKC,OAALD"}
\No newline at end of file