UNPKG

dingtalk-jsapi

Version:

钉钉 模块化 多端统一 API

1 lines 2.03 kB
"use strict";function simpleLogger(e,t){return __awaiter(this,void 0,void 0,function(){var r,n,o,i,a,u,s,l,c;return __generator(this,function(f){switch(f.label){case 0:r=e.method,n=e.params,a=!0,f.label=1;case 1:return f.trys.push([1,3,,4]),[4,t()];case 2:return o=f.sent(),[3,4];case 3:return u=f.sent(),i=u,a=!1,[3,4];case 4:return s=a?o:i,l=a?__1.LogLevel.INFO:__1.LogLevel.WARNING,c=a?"success":"fail",[2,a?Promise.resolve(s):Promise.reject(s)]}})})}var __awaiter=this&&this.__awaiter||function(e,t,r,n){function o(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,i){function a(e){try{s(n.next(e))}catch(e){i(e)}}function u(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){e.done?r(e.value):o(e.value).then(a,u)}s((n=n.apply(e,t||[])).next())})},__generator=this&&this.__generator||function(e,t){function r(e){return function(t){return n([e,t])}}function n(r){if(o)throw new TypeError("Generator is already executing.");for(;s;)try{if(o=1,i&&(a=2&r[0]?i.return:r[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,r[1])).done)return a;switch(i=0,a&&(r=[2&r[0],a.value]),r[0]){case 0:case 1:a=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(a=s.trys,!(a=a.length>0&&a[a.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!a||r[1]>a[0]&&r[1]<a[3])){s.label=r[1];break}if(6===r[0]&&s.label<a[1]){s.label=a[1],a=r;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(r);break}a[2]&&s.ops.pop(),s.trys.pop();continue}r=t.call(e,s)}catch(e){r=[6,e],i=0}finally{o=a=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var o,i,a,u,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return u={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u};Object.defineProperty(exports,"__esModule",{value:!0}),exports.simpleLogger=void 0;var __1=require("..");exports.simpleLogger=simpleLogger;