1 line
4.0 KiB
JSON
1 line
4.0 KiB
JSON
|
{"ast":null,"code":"'use strict';\n\nvar Cancel = require('./Cancel');\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\n\n\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\n\n\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n\n\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;","map":{"version":3,"names":["Cancel","require","CancelToken","executor","TypeError","resolvePromise","promise","Promise","promiseExecutor","resolve","token","cancel","message","reason","prototype","throwIfRequested","source","c","module","exports"],"sources":["/Users/paolasanchez/Desktop/Pry4/Katoikia/katoikia-app/web-ui/sakai-react/node_modules/axios/lib/cancel/CancelToken.js"],"sourcesContent":["'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n"],"mappings":"AAAA;;AAEA,IAAIA,MAAM,GAAGC,OAAO,CAAC,UAAD,CAApB;AAEA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,WAAT,CAAqBC,QAArB,EAA+B;EAC7B,IAAI,OAAOA,QAAP,KAAoB,UAAxB,EAAoC;IAClC,MAAM,IAAIC,SAAJ,CAAc,8BAAd,CAAN;EACD;;EAED,IAAIC,cAAJ;EACA,KAAKC,OAAL,GAAe,IAAIC,OAAJ,CAAY,SAASC,eAAT,CAAyBC,OAAzB,EAAkC;IAC3DJ,cAAc,GAAGI,OAAjB;EACD,CAFc,CAAf;EAIA,IAAIC,KAAK,GAAG,IAAZ;EACAP,QAAQ,CAAC,SAASQ,MAAT,CAAgBC,OAAhB,EAAyB;IAChC,IAAIF,KAAK,CAACG,MAAV,EAAkB;MAChB;MACA;IACD;;IAEDH,KAAK,CAACG,MAAN,GAAe,IAAIb,MAAJ,CAAWY,OAAX,CAAf;IACAP,cAAc,CAACK,KAAK,CAACG,MAAP,CAAd;EACD,CARO,CAAR;AASD;AAED;AACA;AACA;;;AACAX,WAAW,CAACY,SAAZ,CAAsBC,gBAAtB,GAAyC,SAASA,gBAAT,GAA4B;EACnE,IAAI,KAAKF,MAAT,EAAiB;IACf,MAAM,KAAKA,MAAX;EACD;AACF,CAJD;AAMA;AACA;AACA;AACA;;;AACAX,WAAW,CAACc,MAAZ,GAAqB,SAASA,MAAT,GAAkB;EACrC,IAAIL,MAAJ;EACA,IAAID,KAAK,GAAG,IAAIR,WAAJ,CAAgB,SAASC,QAAT,CAAkBc,CAAlB,EAAqB;IAC/CN,MAAM,GAAGM,CAAT;EACD,CAFW,CAAZ;EAGA,OAAO;IACLP,KAAK,EAAEA,KADF;IAELC,MAAM,EAAEA;EAFH,CAAP;AAID,CATD;;AAWAO,MAAM,CAACC,OAAP,GAAiBjB,WAAjB"},"metadata":{},"sourceType":"script"}
|