From ada802ae0530bf4db3a5d8bb160a085fbe363e46 Mon Sep 17 00:00:00 2001 From: Brian Cavalier Date: Tue, 6 Feb 2018 21:50:37 -0500 Subject: [PATCH] v1.4.0 --- dist/creed.es.js | 142 ++++++++++++++++++++++++++++++++---------- dist/creed.es.js.map | 2 +- dist/creed.js | 144 +++++++++++++++++++++++++++++++++---------- dist/creed.js.map | 2 +- dist/creed.min.js | 2 +- package.json | 2 +- 6 files changed, 225 insertions(+), 69 deletions(-) diff --git a/dist/creed.es.js b/dist/creed.es.js index c5a546f..614235c 100644 --- a/dist/creed.es.js +++ b/dist/creed.es.js @@ -79,11 +79,11 @@ var isDebug = getenv('CREED_DEBUG') || /* global process,document */ -var makeAsync = function (f) { +function makeAsync (f) { return isNode ? createNodeScheduler(f) /* istanbul ignore next */ : MutationObs ? createBrowserScheduler(f) : createFallbackScheduler(f) -}; +} /* istanbul ignore next */ function createFallbackScheduler (f) { @@ -177,11 +177,12 @@ var captureStackTrace = Error.captureStackTrace || noop; var Context = function Context (next, tag, at) { this.next = next; this.tag = tag; + this.name = tag ? (" from " + tag + ":") : ' from previous context:'; captureStackTrace(this, at); }; Context.prototype.toString = function toString () { - return this.tag ? (" from " + (this.tag) + ":") : ' from previous context:' + return this.name }; // ------------------------------------------------------ @@ -211,7 +212,7 @@ function formatContext (trace, context) { } var elideTraceRx = - /\s*at\s.*(creed[\\/](src|dist)[\\/]|internal[\\/]process[\\/]|\((timers|module)\.js).+:\d.*/g; + /\s*at\s.*(creed[\\/](src|dist)[\\/]|\((\w+|internal[\\/].+\.js)).+:\d.*/g; // Remove internal stack frames var elideTrace = function (stack) { return typeof stack === 'string' ? stack.replace(elideTraceRx, '') : ''; }; @@ -262,7 +263,8 @@ function reportAll (rejections, report) { var UNHANDLED_REJECTION$1 = 'unhandledRejection'; -var makeEmitError = function () { +function makeEmitError () { + /* eslint complexity: [2, 5] */ /* global process, self, CustomEvent */ // istanbul ignore else */ if (isNode && typeof process.emit === 'function') { @@ -301,7 +303,7 @@ var makeEmitError = function () { // istanbul ignore next */ return noop$1 -}; +} // istanbul ignore next */ function noop$1 () {} @@ -380,10 +382,80 @@ function handleThen (promise, result) { promise._resolve(result); } -var map = function (f, p, promise) { +function _finally (resolve, f, p, promise) { + p._when(new Finally(resolve, f, promise)); + return promise +} + +var Finally = (function (Action$$1) { + function Finally (resolve, f, promise) { + Action$$1.call(this, promise); + this.resolve = resolve; + this.f = f; + } + + if ( Action$$1 ) Finally.__proto__ = Action$$1; + Finally.prototype = Object.create( Action$$1 && Action$$1.prototype ); + Finally.prototype.constructor = Finally; + + Finally.prototype.fulfilled = function fulfilled (p) { + this.runFinally(this.f, p); + }; + + Finally.prototype.rejected = function rejected (p) { + return this.runFinally(this.f, p) + }; + + Finally.prototype.runFinally = function runFinally (f, p) { + var result; + // test iff `f` throws + try { + result = f(); + } catch (e) { + this.promise._reject(e); + return true + } + return this.handleFinally(p, result) + }; + + Finally.prototype.handleFinally = function handleFinally (p, finallyResult) { + if (maybeThenable(finallyResult)) { + this.resolve(finallyResult)._when(new DeferredFinally(p, this.promise)); + return true + } + + this.promise._become(p); + return false + }; + + return Finally; +}(Action)); + +var DeferredFinally = (function (Action$$1) { + function DeferredFinally (result, promise) { + Action$$1.call(this, promise); + this.result = result; + } + + if ( Action$$1 ) DeferredFinally.__proto__ = Action$$1; + DeferredFinally.prototype = Object.create( Action$$1 && Action$$1.prototype ); + DeferredFinally.prototype.constructor = DeferredFinally; + + DeferredFinally.prototype.fulfilled = function fulfilled (p) { + if (isRejected(this.result)) { + this.promise._reject(this.result.value); + return + } + this.promise._become(this.result); + }; + + return DeferredFinally; +}(Action)); + +function map (f, p, promise) { p._when(new Map(f, promise)); return promise -}; +} var Map = (function (Action$$1) { function Map (f, promise) { @@ -406,10 +478,10 @@ function handleMap (promise, result) { promise._fulfill(result); } -var bimap = function (r, f, p, promise) { +function bimap (r, f, p, promise) { p._when(new Bimap(r, f, promise)); return promise -}; +} var Bimap = (function (Map$$1) { function Bimap (r, f, promise) { @@ -432,10 +504,10 @@ function handleMapRejected (promise, result) { promise._reject(result); } -var chain = function (f, p, promise) { +function chain (f, p, promise) { p._when(new Chain(f, promise)); return promise -}; +} var Chain = (function (Action$$1) { function Chain (f, promise) { @@ -606,11 +678,6 @@ function createCommonjsModule(fn, module) { var fantasyLand = createCommonjsModule(function (module) { (function() { - 'use strict'; - - /* eslint comma-dangle: ["off"], no-var: ["off"], strict: ["error", "function"] */ - /* global self */ - var mapping = { equals: 'fantasy-land/equals', lte: 'fantasy-land/lte', @@ -619,6 +686,7 @@ var fantasyLand = createCommonjsModule(function (module) { concat: 'fantasy-land/concat', empty: 'fantasy-land/empty', invert: 'fantasy-land/invert', + filter: 'fantasy-land/filter', map: 'fantasy-land/map', contramap: 'fantasy-land/contramap', ap: 'fantasy-land/ap', @@ -678,6 +746,12 @@ Core[fantasyLand.of] = function (x) { return fulfill(x) }; +Core.prototype.finally = function finally$1 (f) { + return typeof f === 'function' + ? _finally(resolve, f, this.near(), new Future()) + : this +}; + Core.prototype[fantasyLand.map] = function (f) { return this.map(f) }; @@ -1035,6 +1109,10 @@ var Never = (function (Core) { return this }; + Never.prototype.finally = function finally$2 () { + return this + }; + Never.prototype.map = function map$$1 () { return this }; @@ -1198,10 +1276,10 @@ Continuation.prototype.run = function run () { this.promise._runAction(this.action); }; -var _delay = function (ms, p, promise) { +function _delay (ms, p, promise) { p._runAction(new Delay(ms, promise)); return promise -}; +} var Delay = (function (Action$$1) { function Delay (time, promise) { @@ -1243,11 +1321,11 @@ var TimeoutError = (function (Error) { return TimeoutError; }(Error)); -var _timeout = function (ms, p, promise) { +function _timeout (ms, p, promise) { var timer = setTimeout(rejectOnTimeout, ms, promise); p._runAction(new Timeout(timer, promise)); return promise -}; +} var Timeout = (function (Action$$1) { function Timeout (timer, promise) { @@ -1339,7 +1417,7 @@ Settle.prototype.check = function check (pending, promise) { } }; -function runPromise$1 (f, thisArg, args, promise) { +function runPromise (f, thisArg, args, promise) { /* eslint complexity:[2,5] */ function resolve (x) { var c = swapContext(promise.context); @@ -1374,7 +1452,7 @@ function runPromise$1 (f, thisArg, args, promise) { return promise } -function runNode$1 (f, thisArg, args, promise) { +function runNode (f, thisArg, args, promise) { /* eslint complexity:[2,5] */ function settleNode (e, x) { var c = swapContext(promise.context); @@ -1407,10 +1485,10 @@ function runNode$1 (f, thisArg, args, promise) { return promise } -var _runCoroutine = function (resolve, iterator, promise) { +function _runCoroutine (resolve, iterator, promise) { new Coroutine(resolve, iterator, promise).run(); return promise -}; +} var Coroutine = (function (Action$$1) { function Coroutine (resolve, iterator, promise) { @@ -1506,17 +1584,17 @@ function fromNode (f) { var args = [], len = arguments.length; while ( len-- ) args[ len ] = arguments[ len ]; - return runResolver(runNode$1, f, this, args, new Future()) + return runResolver(runNode, f, this, args, new Future()) } } // runNode :: NodeApi e a -> ...* -> Promise e a // Run a Node API, returning a promise for the outcome -function runNode (f) { +function runNode$1 (f) { var args = [], len = arguments.length - 1; while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ]; - return runResolver(runNode$1, f, this, args, new Future()) + return runResolver(runNode, f, this, args, new Future()) } // ------------------------------------------------------------- @@ -1527,11 +1605,11 @@ function runNode (f) { // type Reject e = e -> () // type Producer e a = (...* -> Resolve e a -> Reject e -> ()) // runPromise :: Producer e a -> ...* -> Promise e a -function runPromise (f) { +function runPromise$1 (f) { var args = [], len = arguments.length - 1; while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ]; - return runResolver(runPromise$1, f, this, args, new Future()) + return runResolver(runPromise, f, this, args, new Future()) } function runResolver (run, f, thisArg, args, p) { @@ -1638,7 +1716,7 @@ var NOARGS = []; var CreedPromise = (function (Future$$1) { function CreedPromise (f) { Future$$1.call(this); - runResolver(runPromise$1, f, void 0, NOARGS, this); + runResolver(runPromise, f, void 0, NOARGS, this); } if ( Future$$1 ) CreedPromise.__proto__ = Future$$1; @@ -1673,5 +1751,5 @@ if (typeof Promise !== 'function') { shim(); } -export { enableAsyncTraces, disableAsyncTraces, resolve, reject, future, never, fulfill, all, race, isFulfilled, isRejected, isSettled, isPending, isNever, isHandled, getValue, getReason, coroutine, fromNode, runNode, runPromise, delay, timeout, any, settle, merge, shim, CreedPromise as Promise }; +export { enableAsyncTraces, disableAsyncTraces, resolve, reject, future, never, fulfill, all, race, isFulfilled, isRejected, isSettled, isPending, isNever, isHandled, getValue, getReason, coroutine, fromNode, runNode$1 as runNode, runPromise$1 as runPromise, delay, timeout, any, settle, merge, shim, CreedPromise as Promise }; //# sourceMappingURL=creed.es.js.map diff --git a/dist/creed.es.js.map b/dist/creed.es.js.map index 32693e0..703f9a2 100644 --- a/dist/creed.es.js.map +++ b/dist/creed.es.js.map @@ -1 +1 @@ -{"version":3,"file":"creed.es.js","sources":["../src/state.js","../src/inspect.js","../src/env.js","../src/async.js","../src/TaskQueue.js","../src/trace.js","../src/ErrorHandler.js","../src/emitError.js","../src/maybeThenable.js","../src/Action.js","../src/tryCall.js","../src/then.js","../src/map.js","../src/bimap.js","../src/chain.js","../src/Race.js","../src/Merge.js","../src/iterable.js","../node_modules/fantasy-land/index.js","../src/Promise.js","../src/delay.js","../src/TimeoutError.js","../src/timeout.js","../src/Any.js","../src/Settle.js","../src/runPromise.js","../src/node.js","../src/coroutine.js","../src/main.js"],"sourcesContent":["/* eslint no-multi-spaces: 0 */\nexport const PENDING = 1 << 0\nexport const FULFILLED = 1 << 1\nexport const REJECTED = 1 << 2\nexport const SETTLED = FULFILLED | REJECTED\nexport const NEVER = 1 << 3\n\nexport const HANDLED = 1 << 4\n","import { PENDING, FULFILLED, REJECTED, SETTLED, NEVER, HANDLED } from './state'\n\nexport function isPending (p) {\n return (p.state() & PENDING) > 0\n}\n\nexport function isFulfilled (p) {\n return (p.state() & FULFILLED) > 0\n}\n\nexport function isRejected (p) {\n return (p.state() & REJECTED) > 0\n}\n\nexport function isSettled (p) {\n return (p.state() & SETTLED) > 0\n}\n\nexport function isNever (p) {\n return (p.state() & NEVER) > 0\n}\n\nexport function isHandled (p) {\n return (p.state() & HANDLED) > 0\n}\n\nexport function getValue (p) {\n const n = p.near()\n if (!isFulfilled(n)) {\n throw new TypeError('getValue called on ' + p)\n }\n\n return n.value\n}\n\nexport function getReason (p) {\n const n = p.near()\n if (!isRejected(n)) {\n throw new TypeError('getReason called on ' + p)\n }\n\n silenceError(n)\n return n.value\n}\n\nexport function silenceError (p) {\n p._runAction(silencer)\n}\n\n// implements Action\nconst silencer = {\n fulfilled () {},\n rejected (p) {\n p._state |= HANDLED\n }\n}\n","/* global process,MutationObserver,WebKitMutationObserver */\n\nconst isNode = typeof process !== 'undefined' &&\n Object.prototype.toString.call(process) === '[object process]'\n\n/* istanbul ignore next */\nconst MutationObs = (typeof MutationObserver === 'function' && MutationObserver) ||\n (typeof WebKitMutationObserver === 'function' && WebKitMutationObserver)\n\nconst getenv = name => isNode && process.env[name]\n\nconst isDebug = getenv('CREED_DEBUG') ||\n getenv('NODE_ENV') === 'development' ||\n getenv('NODE_ENV') === 'test'\n\nexport { isNode, MutationObs, isDebug }\n","import { isNode, MutationObs } from './env'\n\n/* global process,document */\n\nexport default function (f) {\n return isNode ? createNodeScheduler(f) /* istanbul ignore next */\n : MutationObs ? createBrowserScheduler(f)\n : createFallbackScheduler(f)\n}\n\n/* istanbul ignore next */\nfunction createFallbackScheduler (f) {\n return () => setTimeout(f, 0)\n}\n\nfunction createNodeScheduler (f) {\n return () => process.nextTick(f)\n}\n\n/* istanbul ignore next */\nfunction createBrowserScheduler (f) {\n const node = document.createTextNode('')\n new MutationObs(f).observe(node, { characterData: true })\n\n let i = 0\n return () => { node.data = (i ^= 1) }\n}\n","import makeAsync from './async'\n\nexport default class TaskQueue {\n constructor () {\n this.tasks = new Array(2 << 15)\n this.length = 0\n this.drain = makeAsync(() => this._drain())\n }\n\n add (task) {\n if (this.length === 0) {\n this.drain()\n }\n\n this.tasks[this.length++] = task\n }\n\n _drain () {\n const q = this.tasks\n for (let i = 0; i < this.length; ++i) {\n q[i].run()\n q[i] = void 0\n }\n this.length = 0\n }\n}\n","const noop = () => {}\n\n// WARNING: shared mutable notion of \"current context\"\nlet _currentContext\nlet _createContext = noop\n\n// Get the current context\nexport const peekContext = () => _currentContext\n\n// Append a new context to the current, and set the current context\n// to the newly appended one\nexport const pushContext = (at, tag) =>\n _createContext(_currentContext, at, tag)\n\n// Set the current context to the provided one, returning the\n// previously current context (which makes it easy to swap back\n// to it)\nexport const swapContext = context => {\n const previousContext = _currentContext\n _currentContext = context\n return previousContext\n}\n\n// Enable context tracing. Must provide:\n// createContext :: c -> Function -> String -> c\n// Given the current context, and a function and string tag representing a new context,\n// return a new current context\n// initialContext :: c\n// An initial current context\nexport const traceAsync = (createContext, initialContext) => {\n _createContext = createContext\n _currentContext = initialContext\n}\n\n// Enable default context tracing\nexport const enableAsyncTraces = () =>\n traceAsync(createContext, undefined)\n\n// Disable context tracing\nexport const disableAsyncTraces = () =>\n traceAsync(noop, undefined)\n\n// ------------------------------------------------------\n// Default context tracing\n\nexport const createContext = (currentContext, at, tag) =>\n new Context(currentContext, tag || at.name, at)\n\nexport const captureStackTrace = Error.captureStackTrace || noop\n\nexport class Context {\n constructor (next, tag, at) {\n this.next = next\n this.tag = tag\n captureStackTrace(this, at)\n }\n\n toString () {\n return this.tag ? ` from ${this.tag}:` : ' from previous context:'\n }\n}\n\n// ------------------------------------------------------\n// Default context formatting\n\n// If context provided, attach an async trace for it.\n// Otherwise, do nothing.\nexport const attachTrace = (e, context) =>\n context != null ? formatTrace(e, context) : e\n\n// If e is an Error, attach an async trace to e for the provided context\n// Otherwise, do nothing\nexport function formatTrace (e, context) {\n if (e instanceof Error && !('_creed$OriginalStack' in e)) {\n e._creed$OriginalStack = e.stack\n e.stack = formatContext(elideTrace(e.stack), context)\n }\n return e\n}\n\n// Fold context list into a newline-separated, combined async trace\nexport function formatContext (trace, context) {\n if (context == null) {\n return trace\n }\n const s = elideTrace(context.stack)\n return formatContext(s.indexOf(' at ') < 0 ? trace : (trace + '\\n' + s), context.next)\n}\n\nexport const elideTraceRx =\n /\\s*at\\s.*(creed[\\\\/](src|dist)[\\\\/]|internal[\\\\/]process[\\\\/]|\\((timers|module)\\.js).+:\\d.*/g\n\n// Remove internal stack frames\nexport const elideTrace = stack =>\n typeof stack === 'string' ? stack.replace(elideTraceRx, '') : ''\n","import { silenceError, isHandled } from './inspect'\nimport { attachTrace } from './trace'\n\nconst UNHANDLED_REJECTION = 'unhandledRejection'\nconst HANDLED_REJECTION = 'rejectionHandled'\n\nexport default class ErrorHandler {\n constructor (emitEvent, reportError) {\n this.rejections = []\n this.emit = emitEvent\n this.reportError = reportError\n }\n\n track (rejected) {\n const e = attachTrace(rejected.value, rejected.context)\n\n if (!this.emit(UNHANDLED_REJECTION, rejected, e)) {\n /* istanbul ignore else */\n if (this.rejections.length === 0) {\n setTimeout(reportErrors, 1, this.reportError, this.rejections)\n }\n this.rejections.push(rejected)\n }\n }\n\n untrack (rejected) {\n silenceError(rejected)\n this.emit(HANDLED_REJECTION, rejected)\n }\n}\n\nfunction reportErrors (report, rejections) {\n try {\n reportAll(rejections, report)\n } finally {\n rejections.length = 0\n }\n}\n\nfunction reportAll (rejections, report) {\n for (let i = 0; i < rejections.length; ++i) {\n const rejected = rejections[i]\n /* istanbul ignore else */\n if (!isHandled(rejected)) {\n report(rejected)\n }\n }\n}\n","import { isNode } from './env'\n\nconst UNHANDLED_REJECTION = 'unhandledRejection'\n\nexport default function () {\n /* global process, self, CustomEvent */\n // istanbul ignore else */\n if (isNode && typeof process.emit === 'function') {\n // Returning falsy here means to call the default reportRejection API.\n // This is safe even in browserify since process.emit always returns\n // falsy in browserify:\n // https://github.com/defunctzombie/node-process/blob/master/browser.js#L40-L46\n return function (type, error) {\n return type === UNHANDLED_REJECTION\n ? process.emit(type, error.value, error)\n : process.emit(type, error)\n }\n } else if (typeof self !== 'undefined' && typeof CustomEvent === 'function') {\n return (function (noop, self, CustomEvent) {\n var hasCustomEvent\n try {\n hasCustomEvent = new CustomEvent(UNHANDLED_REJECTION) instanceof CustomEvent\n } catch (e) {\n hasCustomEvent = false\n }\n\n return !hasCustomEvent ? noop : function (type, error) {\n const ev = new CustomEvent(type, {\n detail: {\n reason: error.value,\n promise: error\n },\n bubbles: false,\n cancelable: true\n })\n\n return !self.dispatchEvent(ev)\n }\n }(noop, self, CustomEvent))\n }\n\n // istanbul ignore next */\n return noop\n}\n\n// istanbul ignore next */\nfunction noop () {}\n","// maybeThenable :: * -> boolean\nexport default function maybeThenable (x) {\n return (typeof x === 'object' || typeof x === 'function') && x !== null\n}\n","import { pushContext } from './trace'\n\nexport default class Action {\n constructor (promise) {\n this.promise = promise\n this.context = pushContext(this.constructor)\n }\n\n // default onFulfilled action\n /* istanbul ignore next */\n fulfilled (p) {\n this.promise._become(p)\n }\n\n // default onRejected action\n rejected (p) {\n this.promise._become(p)\n return false\n }\n}\n","export default function tryCall (f, x, handle, promise) {\n let result\n // test if `f` (and only it) throws\n try {\n result = f(x)\n } catch (e) {\n promise._reject(e)\n return\n } // else\n handle(promise, result)\n}\n","import Action from './Action'\nimport tryCall from './tryCall'\n\nexport default function then (f, r, p, promise) {\n p._when(new Then(f, r, promise))\n return promise\n}\n\nclass Then extends Action {\n constructor (f, r, promise) {\n super(promise)\n this.f = f\n this.r = r\n }\n\n fulfilled (p) {\n this.runThen(this.f, p)\n }\n\n rejected (p) {\n return this.runThen(this.r, p)\n }\n\n runThen (f, p) {\n if (typeof f !== 'function') {\n this.promise._become(p)\n return false\n }\n tryCall(f, p.value, handleThen, this.promise)\n return true\n }\n}\n\nfunction handleThen (promise, result) {\n promise._resolve(result)\n}\n","import Action from './Action'\nimport tryCall from './tryCall'\n\nexport default function (f, p, promise) {\n p._when(new Map(f, promise))\n return promise\n}\n\nexport class Map extends Action {\n constructor (f, promise) {\n super(promise)\n this.f = f\n }\n\n fulfilled (p) {\n tryCall(this.f, p.value, handleMap, this.promise)\n }\n}\n\nfunction handleMap (promise, result) {\n promise._fulfill(result)\n}\n","import { Map } from './map'\nimport tryCall from './tryCall'\n\nexport default function (r, f, p, promise) {\n p._when(new Bimap(r, f, promise))\n return promise\n}\n\nclass Bimap extends Map {\n constructor (r, f, promise) {\n super(f, promise)\n this.r = r\n }\n\n rejected (p) {\n tryCall(this.r, p.value, handleMapRejected, this.promise)\n }\n}\n\nfunction handleMapRejected (promise, result) {\n promise._reject(result)\n}\n","import Action from './Action'\nimport tryCall from './tryCall'\nimport maybeThenable from './maybeThenable'\n\nexport default function (f, p, promise) {\n p._when(new Chain(f, promise))\n return promise\n}\n\nclass Chain extends Action {\n constructor (f, promise) {\n super(promise)\n this.f = f\n }\n\n fulfilled (p) {\n tryCall(this.f, p.value, handleChain, this.promise)\n }\n}\n\nfunction handleChain (promise, result) {\n if (!(maybeThenable(result) && typeof result.then === 'function')) {\n promise._reject(new TypeError('f must return a promise'))\n }\n\n promise._resolve(result)\n}\n","import { silenceError } from './inspect'\n\nexport default class Race {\n valueAt (x, i, promise) {\n promise._fulfill(x)\n }\n\n fulfillAt (p, i, promise) {\n promise._become(p)\n }\n\n rejectAt (p, i, promise) {\n // In the case where the result promise has been resolved\n // need to silence all subsequently seen rejections\n promise._isResolved() ? silenceError(p) : promise._become(p)\n }\n\n complete (total, promise) {\n if (total === 0) {\n promise._become(promise.constructor.empty())\n }\n }\n}\n","import { silenceError } from './inspect'\n\nexport default class Merge {\n constructor (mergeHandler, results) {\n this.pending = 0\n this.results = results\n this.mergeHandler = mergeHandler\n }\n\n valueAt (x, i, promise) {\n this.results[i] = x\n this.check(this.pending - 1, promise)\n }\n\n fulfillAt (p, i, promise) {\n this.valueAt(p.value, i, promise)\n }\n\n rejectAt (p, i, promise) {\n // In the case where the result promise has been resolved\n // need to silence all subsequently seen rejections\n promise._isResolved() ? silenceError(p) : promise._become(p)\n }\n\n complete (total, promise) {\n this.check(this.pending + total, promise)\n }\n\n check (pending, promise) {\n this.pending = pending\n if (pending === 0) {\n this.mergeHandler.merge(promise, this.results)\n }\n }\n}\n","import { isFulfilled, isRejected, silenceError } from './inspect'\nimport Action from './Action'\nimport maybeThenable from './maybeThenable'\n\nexport function resultsArray (iterable) {\n return Array.isArray(iterable) ? new Array(iterable.length) : []\n}\n\nexport function resolveIterable (resolve, handler, promises, promise) {\n const run = Array.isArray(promises) ? runArray : runIterable\n try {\n run(resolve, handler, promises, promise)\n } catch (e) {\n promise._reject(e)\n }\n return promise.near()\n}\n\nfunction runArray (resolve, handler, promises, promise) {\n let i = 0\n\n for (; i < promises.length; ++i) {\n handleItem(resolve, handler, promises[i], i, promise)\n }\n\n handler.complete(i, promise)\n}\n\nfunction runIterable (resolve, handler, promises, promise) {\n let i = 0\n const iter = promises[Symbol.iterator]()\n\n while (true) {\n const step = iter.next()\n if (step.done) {\n break\n }\n handleItem(resolve, handler, step.value, i++, promise)\n }\n\n handler.complete(i, promise)\n}\n\nfunction handleItem (resolve, handler, x, i, promise) {\n /* eslint complexity:[1,6] */\n if (!maybeThenable(x)) {\n handler.valueAt(x, i, promise)\n return\n }\n\n const p = resolve(x)\n\n if (promise._isResolved()) {\n if (!isFulfilled(p)) {\n silenceError(p)\n }\n } else if (isFulfilled(p)) {\n handler.fulfillAt(p, i, promise)\n } else if (isRejected(p)) {\n handler.rejectAt(p, i, promise)\n } else {\n p._runAction(new AtIndex(handler, i, promise))\n }\n}\n\nclass AtIndex extends Action {\n constructor (handler, i, promise) {\n super(promise)\n this.i = i\n this.handler = handler\n }\n\n fulfilled (p) {\n this.handler.fulfillAt(p, this.i, this.promise)\n }\n\n rejected (p) {\n return this.handler.rejectAt(p, this.i, this.promise)\n }\n}\n","(function() {\n\n 'use strict';\n\n /* eslint comma-dangle: [\"off\"], no-var: [\"off\"], strict: [\"error\", \"function\"] */\n /* global self */\n\n var mapping = {\n equals: 'fantasy-land/equals',\n lte: 'fantasy-land/lte',\n compose: 'fantasy-land/compose',\n id: 'fantasy-land/id',\n concat: 'fantasy-land/concat',\n empty: 'fantasy-land/empty',\n invert: 'fantasy-land/invert',\n map: 'fantasy-land/map',\n contramap: 'fantasy-land/contramap',\n ap: 'fantasy-land/ap',\n of: 'fantasy-land/of',\n alt: 'fantasy-land/alt',\n zero: 'fantasy-land/zero',\n reduce: 'fantasy-land/reduce',\n traverse: 'fantasy-land/traverse',\n chain: 'fantasy-land/chain',\n chainRec: 'fantasy-land/chainRec',\n extend: 'fantasy-land/extend',\n extract: 'fantasy-land/extract',\n bimap: 'fantasy-land/bimap',\n promap: 'fantasy-land/promap'\n };\n\n if (typeof module === 'object' && typeof module.exports === 'object') {\n module.exports = mapping;\n } else {\n self.FantasyLand = mapping;\n }\n\n}());\n","import TaskQueue from './TaskQueue'\nimport ErrorHandler from './ErrorHandler'\nimport makeEmitError from './emitError'\nimport maybeThenable from './maybeThenable'\nimport { PENDING, FULFILLED, REJECTED, NEVER } from './state'\nimport { isNever, isSettled } from './inspect'\n\nimport then from './then'\nimport map from './map'\nimport bimap from './bimap'\nimport chain from './chain'\n\nimport Race from './Race'\nimport Merge from './Merge'\nimport { resolveIterable, resultsArray } from './iterable'\n\nimport { swapContext, peekContext } from './trace'\n\nimport fl from 'fantasy-land'\n\nconst taskQueue = new TaskQueue()\nexport { taskQueue }\n\n/* istanbul ignore next */\nconst handleError = ({ value }) => { throw value }\n\n/* istanbul ignore next */\nconst errorHandler = new ErrorHandler(makeEmitError(), handleError)\n\n// -------------------------------------------------------------\n// ## Types\n// -------------------------------------------------------------\n\n// Internal base type, provides fantasy-land namespace\n// and type representative\nclass Core {\n constructor () {\n this.context = peekContext()\n }\n // empty :: Promise e a\n static empty () {\n return never()\n }\n\n // of :: a -> Promise e a\n static of (x) {\n return fulfill(x)\n }\n\n static [fl.empty] () {\n return never()\n }\n\n static [fl.of] (x) {\n return fulfill(x)\n }\n\n [fl.map] (f) {\n return this.map(f)\n }\n\n [fl.bimap] (r, f) {\n return this.bimap(r, f)\n }\n\n [fl.ap] (pf) {\n return pf.ap(this)\n }\n\n [fl.chain] (f) {\n return this.chain(f)\n }\n\n [fl.concat] (p) {\n return this.concat(p)\n }\n\n [fl.alt] (p) {\n return this.or(p)\n }\n\n static [fl.zero] () {\n return never()\n }\n\n // @deprecated The name concat is deprecated, use or() instead.\n concat (b) {\n return this.or(b)\n }\n}\n\n// data Promise e a where\n// Future :: Promise e a\n// Fulfilled :: a -> Promise e a\n// Rejected :: Error e => e -> Promise e a\n// Never :: Promise e a\n\n// Future :: Promise e a\n// A promise whose value cannot be known until some future time\nexport class Future extends Core {\n constructor () {\n super()\n this.ref = void 0\n this.action = void 0\n this.length = 0\n }\n\n // then :: Promise e a -> (a -> b) -> Promise e b\n // then :: Promise e a -> () -> (e -> b) -> Promise e b\n // then :: Promise e a -> (a -> b) -> (e -> b) -> Promise e b\n then (f, r) {\n const n = this.near()\n return n === this ? then(f, r, this, new Future()) : n.then(f, r)\n }\n\n // catch :: Promise e a -> (e -> b) -> Promise e b\n catch (r) {\n const n = this.near()\n return n === this ? then(void 0, r, this, new Future()) : n.catch(r)\n }\n\n // map :: Promise e a -> (a -> b) -> Promise e b\n map (f) {\n const n = this.near()\n return n === this ? map(f, this, new Future()) : n.map(f)\n }\n\n bimap (r, f) {\n const n = this.near()\n return n === this\n ? bimap(r, f, this, new Future())\n : n.bimap(r, f)\n }\n\n // ap :: Promise e (a -> b) -> Promise e a -> Promise e b\n ap (p) {\n const n = this.near()\n const pn = p.near()\n return n === this ? this.chain(f => pn.map(f)) : n.ap(pn)\n }\n\n // chain :: Promise e a -> (a -> Promise e b) -> Promise e b\n chain (f) {\n const n = this.near()\n return n === this ? chain(f, this, new Future()) : n.chain(f)\n }\n\n // or :: Promise e a -> Promise e a -> Promise e a\n or (b) {\n /* eslint complexity:[2,5] */\n const n = this.near()\n const bn = b.near()\n\n return isSettled(n) || isNever(bn) ? n\n : isSettled(bn) || isNever(n) ? bn\n : race([n, bn])\n }\n\n // toString :: Promise e a -> String\n toString () {\n return '[object ' + this.inspect() + ']'\n }\n\n // inspect :: Promise e a -> String\n inspect () {\n const n = this.near()\n return n === this ? 'Promise { pending }' : n.inspect()\n }\n\n // near :: Promise e a -> Promise e a\n near () {\n if (!this._isResolved()) {\n return this\n }\n\n this.ref = this.ref.near()\n return this.ref\n }\n\n // state :: Promise e a -> Int\n state () {\n return this._isResolved() ? this.ref.near().state() : PENDING\n }\n\n _isResolved () {\n return this.ref !== void 0\n }\n\n _when (action) {\n this._runAction(action)\n }\n\n _runAction (action) {\n if (this.action === void 0) {\n this.action = action\n } else {\n this[this.length++] = action\n }\n }\n\n _resolve (x) {\n this._become(resolve(x))\n }\n\n _fulfill (x) {\n this._become(new Fulfilled(x))\n }\n\n _reject (e) {\n if (this._isResolved()) {\n return\n }\n\n this.__become(new Rejected(e))\n }\n\n _become (p) {\n if (this._isResolved()) {\n return\n }\n\n this.__become(p)\n }\n\n __become (p) {\n this.ref = p === this ? cycle() : p\n\n if (this.action === void 0) {\n return\n }\n\n taskQueue.add(this)\n }\n\n run () {\n const p = this.ref.near()\n p._runAction(this.action)\n this.action = void 0\n\n for (let i = 0; i < this.length; ++i) {\n p._runAction(this[i])\n this[i] = void 0\n }\n }\n}\n\n// Fulfilled :: a -> Promise e a\n// A promise whose value is already known\nclass Fulfilled extends Core {\n constructor (x) {\n super()\n this.value = x\n }\n\n then (f) {\n return typeof f === 'function' ? then(f, void 0, this, new Future()) : this\n }\n\n catch () {\n return this\n }\n\n map (f) {\n return map(f, this, new Future())\n }\n\n bimap (_, f) {\n return this.map(f)\n }\n\n ap (p) {\n return p.map(this.value)\n }\n\n chain (f) {\n return chain(f, this, new Future())\n }\n\n or () {\n return this\n }\n\n toString () {\n return '[object ' + this.inspect() + ']'\n }\n\n inspect () {\n return 'Promise { fulfilled: ' + this.value + ' }'\n }\n\n state () {\n return FULFILLED\n }\n\n near () {\n return this\n }\n\n _when (action) {\n taskQueue.add(new Continuation(action, this))\n }\n\n _runAction (action) {\n const c = swapContext(action.context)\n action.fulfilled(this)\n swapContext(c)\n }\n}\n\n// Rejected :: Error e => e -> Promise e a\n// A promise whose value cannot be known due to some reason/error\nclass Rejected extends Core {\n constructor (e) {\n super()\n this.value = e\n this._state = REJECTED\n errorHandler.track(this)\n }\n\n then (_, r) {\n return typeof r === 'function' ? this.catch(r) : this\n }\n\n catch (r) {\n return then(void 0, r, this, new Future())\n }\n\n map () {\n return this\n }\n\n bimap (r) {\n return bimap(r, void 0, this, new Future())\n }\n\n ap () {\n return this\n }\n\n chain () {\n return this\n }\n\n or () {\n return this\n }\n\n toString () {\n return '[object ' + this.inspect() + ']'\n }\n\n inspect () {\n return 'Promise { rejected: ' + this.value + ' }'\n }\n\n state () {\n return this._state\n }\n\n near () {\n return this\n }\n\n _when (action) {\n taskQueue.add(new Continuation(action, this))\n }\n\n _runAction (action) {\n const c = swapContext(action.context)\n if (action.rejected(this)) {\n errorHandler.untrack(this)\n }\n swapContext(c)\n }\n}\n\n// Never :: Promise e a\n// A promise that waits forever for its value to be known\nclass Never extends Core {\n then () {\n return this\n }\n\n catch () {\n return this\n }\n\n map () {\n return this\n }\n\n bimap () {\n return this\n }\n\n ap () {\n return this\n }\n\n chain () {\n return this\n }\n\n or (b) {\n return b\n }\n\n toString () {\n return '[object ' + this.inspect() + ']'\n }\n\n inspect () {\n return 'Promise { never }'\n }\n\n state () {\n return PENDING | NEVER\n }\n\n near () {\n return this\n }\n\n _when () {\n }\n\n _runAction () {\n }\n}\n\n// -------------------------------------------------------------\n// ## Creating promises\n// -------------------------------------------------------------\n\n// resolve :: Thenable e a -> Promise e a\n// resolve :: a -> Promise e a\nexport function resolve (x) {\n return isPromise(x) ? x.near()\n : maybeThenable(x) ? refForMaybeThenable(fulfill, x)\n : new Fulfilled(x)\n}\n\n// reject :: e -> Promise e a\nexport function reject (e) {\n return new Rejected(e)\n}\n\n// never :: Promise e a\nexport function never () {\n return new Never()\n}\n\n// fulfill :: a -> Promise e a\nexport function fulfill (x) {\n return new Fulfilled(x)\n}\n\n// future :: () -> { resolve: Resolve e a, promise: Promise e a }\n// type Resolve e a = a|Thenable e a -> ()\nexport function future () {\n const promise = new Future()\n return {resolve: x => promise._resolve(x), promise}\n}\n\n// -------------------------------------------------------------\n// ## Iterables\n// -------------------------------------------------------------\n\n// all :: Iterable (Promise e a) -> Promise e [a]\nexport function all (promises) {\n const handler = new Merge(allHandler, resultsArray(promises))\n return iterablePromise(handler, promises)\n}\n\nconst allHandler = {\n merge (promise, args) {\n promise._fulfill(args)\n }\n}\n\n// race :: Iterable (Promise e a) -> Promise e a\nexport function race (promises) {\n return iterablePromise(new Race(), promises)\n}\n\nfunction isIterable (x) {\n return typeof x === 'object' && x !== null\n}\n\nexport function iterablePromise (handler, iterable) {\n if (!isIterable(iterable)) {\n return reject(new TypeError('expected an iterable'))\n }\n\n const p = new Future()\n return resolveIterable(resolveMaybeThenable, handler, iterable, p)\n}\n\n// -------------------------------------------------------------\n// # Internals\n// -------------------------------------------------------------\n\n// isPromise :: * -> boolean\nfunction isPromise (x) {\n return x instanceof Core\n}\n\nfunction resolveMaybeThenable (x) {\n return isPromise(x) ? x.near() : refForMaybeThenable(fulfill, x)\n}\n\nfunction refForMaybeThenable (otherwise, x) {\n try {\n const then = x.then\n return typeof then === 'function'\n ? extractThenable(then, x)\n : otherwise(x)\n } catch (e) {\n return new Rejected(e)\n }\n}\n\n// WARNING: Naming the first arg \"then\" triggers babel compilation bug\nfunction extractThenable (thn, thenable) {\n const p = new Future()\n\n try {\n thn.call(thenable, x => p._resolve(x), e => p._reject(e))\n } catch (e) {\n p._reject(e)\n }\n\n return p.near()\n}\n\nfunction cycle () {\n return new Rejected(new TypeError('resolution cycle'))\n}\n\nclass Continuation {\n constructor (action, promise) {\n this.action = action\n this.promise = promise\n }\n\n run () {\n this.promise._runAction(this.action)\n }\n}\n","import Action from './Action'\n\nexport default function (ms, p, promise) {\n p._runAction(new Delay(ms, promise))\n return promise\n}\n\nclass Delay extends Action {\n constructor (time, promise) {\n super(promise)\n this.time = time\n }\n\n fulfilled (p) {\n /* global setTimeout */\n setTimeout(become, this.time, p, this.promise)\n }\n}\n\nfunction become (p, promise) {\n promise._become(p)\n}\n","export default class TimeoutError extends Error {\n constructor (message) {\n super()\n this.message = message\n this.name = TimeoutError.name\n /* istanbul ignore else */\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, TimeoutError)\n }\n }\n}\n","import Action from './Action'\nimport TimeoutError from './TimeoutError'\n\nexport default function (ms, p, promise) {\n const timer = setTimeout(rejectOnTimeout, ms, promise)\n p._runAction(new Timeout(timer, promise))\n return promise\n}\n\nclass Timeout extends Action {\n constructor (timer, promise) {\n super(promise)\n this.timer = timer\n }\n\n fulfilled (p) {\n clearTimeout(this.timer)\n this.promise._become(p)\n }\n\n rejected (p) {\n clearTimeout(this.timer)\n return super.rejected(p)\n }\n}\n\nfunction rejectOnTimeout (promise) {\n promise._reject(new TimeoutError('promise timeout'))\n}\n","import { silenceError } from './inspect.js'\n\nexport default class Any {\n constructor () {\n this.pending = 0\n }\n\n valueAt (x, i, promise) {\n promise._fulfill(x)\n }\n\n fulfillAt (p, i, promise) {\n promise._become(p)\n }\n\n rejectAt (p, i, promise) {\n silenceError(p)\n this.check(this.pending - 1, promise)\n }\n\n complete (total, promise) {\n this.check(this.pending + total, promise)\n }\n\n check (pending, promise) {\n this.pending = pending\n if (pending === 0) {\n promise._reject(new RangeError('No fulfilled promises in input'))\n }\n }\n}\n","import { silenceError } from './inspect'\n\nexport default class Settle {\n constructor (resolve, results) {\n this.pending = 0\n this.results = results\n this.resolve = resolve\n }\n\n valueAt (x, i, promise) {\n this.settleAt(this.resolve(x), i, promise)\n }\n\n fulfillAt (p, i, promise) {\n this.settleAt(p, i, promise)\n }\n\n rejectAt (p, i, promise) {\n silenceError(p)\n this.settleAt(p, i, promise)\n }\n\n settleAt (p, i, promise) {\n this.results[i] = p\n this.check(this.pending - 1, promise)\n }\n\n complete (total, promise) {\n this.check(this.pending + total, promise)\n }\n\n check (pending, promise) {\n this.pending = pending\n if (pending === 0) {\n promise._fulfill(this.results)\n }\n }\n}\n","import { swapContext } from './trace'\n\nexport default function runPromise (f, thisArg, args, promise) {\n /* eslint complexity:[2,5] */\n function resolve (x) {\n const c = swapContext(promise.context)\n promise._resolve(x)\n swapContext(c)\n }\n\n function reject (e) {\n const c = swapContext(promise.context)\n promise._reject(e)\n swapContext(c)\n }\n\n switch (args.length) {\n case 0:\n f.call(thisArg, resolve, reject)\n break\n case 1:\n f.call(thisArg, args[0], resolve, reject)\n break\n case 2:\n f.call(thisArg, args[0], args[1], resolve, reject)\n break\n case 3:\n f.call(thisArg, args[0], args[1], args[2], resolve, reject)\n break\n default:\n args.push(resolve, reject)\n f.apply(thisArg, args)\n }\n\n return promise\n}\n","import { swapContext } from './trace'\n\nexport default function runNode (f, thisArg, args, promise) {\n /* eslint complexity:[2,5] */\n function settleNode (e, x) {\n const c = swapContext(promise.context)\n if (e) {\n promise._reject(e)\n } else {\n promise._fulfill(x)\n }\n swapContext(c)\n }\n\n switch (args.length) {\n case 0:\n f.call(thisArg, settleNode)\n break\n case 1:\n f.call(thisArg, args[0], settleNode)\n break\n case 2:\n f.call(thisArg, args[0], args[1], settleNode)\n break\n case 3:\n f.call(thisArg, args[0], args[1], args[2], settleNode)\n break\n default:\n args.push(settleNode)\n f.apply(thisArg, args)\n }\n\n return promise\n}\n","import Action from './Action'\nimport { swapContext } from './trace'\n\nexport default function (resolve, iterator, promise) {\n new Coroutine(resolve, iterator, promise).run()\n return promise\n}\n\nclass Coroutine extends Action {\n constructor (resolve, iterator, promise) {\n super(promise)\n this.resolve = resolve\n this.generator = iterator\n }\n\n run () {\n this.tryStep(this.generator.next, void 0)\n }\n\n tryStep (resume, x) {\n const context = swapContext(this.context)\n let result\n // test if `resume` (and only it) throws\n try {\n result = resume.call(this.generator, x)\n } catch (e) {\n this.handleReject(e)\n return\n } finally {\n swapContext(context)\n }// else\n\n this.handleResult(result)\n }\n\n handleResult (result) {\n if (result.done) {\n return this.promise._resolve(result.value)\n }\n\n this.resolve(result.value)._when(this)\n }\n\n handleReject (e) {\n this.promise._reject(e)\n }\n\n fulfilled (p) {\n this.tryStep(this.generator.next, p.value)\n }\n\n rejected (p) {\n this.tryStep(this.generator.throw, p.value)\n return true\n }\n}\n","import { isFulfilled, isRejected, isSettled, isPending, isNever, isHandled, getValue, getReason } from './inspect'\nimport { Future, resolve, reject, future, never, fulfill, all, race, iterablePromise, taskQueue } from './Promise'\n\nimport _delay from './delay'\nimport _timeout from './timeout'\n\nimport Any from './Any'\nimport Merge from './Merge'\nimport Settle from './Settle'\nimport { resultsArray } from './iterable'\n\nimport _runPromise from './runPromise'\nimport _runNode from './node'\nimport _runCoroutine from './coroutine.js'\n\nimport { isDebug } from './env'\nimport { swapContext, pushContext, enableAsyncTraces, disableAsyncTraces } from './trace'\n\nexport { enableAsyncTraces, disableAsyncTraces }\n\n/* istanbul ignore next */\nif (isDebug) {\n enableAsyncTraces()\n}\n\n// -------------------------------------------------------------\n// ## Core promise methods\n// -------------------------------------------------------------\n\nexport {\n resolve, reject, future, never, fulfill, all, race,\n isFulfilled, isRejected, isSettled, isPending, isNever, isHandled,\n getValue, getReason\n}\n\n// -------------------------------------------------------------\n// ## Coroutine\n// -------------------------------------------------------------\n\n// coroutine :: Generator e a -> (...* -> Promise e a)\n// Make a coroutine from a promise-yielding generator\nexport function coroutine (generator) {\n return function coroutinified (...args) {\n return runGenerator(generator, this, args)\n }\n}\n\nfunction runGenerator (generator, thisArg, args) {\n const iterator = generator.apply(thisArg, args)\n return _runCoroutine(resolve, iterator, new Future())\n}\n\n// -------------------------------------------------------------\n// ## Node-style async\n// -------------------------------------------------------------\n\n// type Nodeback e a = e -> a -> ()\n// type NodeApi e a = ...* -> Nodeback e a -> ()\n\n// fromNode :: NodeApi e a -> (...args -> Promise e a)\n// Turn a Node API into a promise API\nexport function fromNode (f) {\n return function promisified (...args) {\n return runResolver(_runNode, f, this, args, new Future())\n }\n}\n\n// runNode :: NodeApi e a -> ...* -> Promise e a\n// Run a Node API, returning a promise for the outcome\nexport function runNode (f, ...args) {\n return runResolver(_runNode, f, this, args, new Future())\n}\n\n// -------------------------------------------------------------\n// ## Make a promise\n// -------------------------------------------------------------\n\n// type Resolve e a = a|Thenable e a -> ()\n// type Reject e = e -> ()\n// type Producer e a = (...* -> Resolve e a -> Reject e -> ())\n// runPromise :: Producer e a -> ...* -> Promise e a\nexport function runPromise (f, ...args) {\n return runResolver(_runPromise, f, this, args, new Future())\n}\n\nfunction runResolver (run, f, thisArg, args, p) {\n checkFunction(f)\n\n try {\n run(f, thisArg, args, p)\n } catch (e) {\n p._reject(e)\n }\n\n return p\n}\n\n// -------------------------------------------------------------\n// ## Time\n// -------------------------------------------------------------\n\n// delay :: number -> Promise e a -> Promise e a\nexport function delay (ms, x) {\n /* eslint complexity:[2,4] */\n const p = resolve(x)\n return ms <= 0 || isRejected(p) || isNever(p) ? p\n : _delay(ms, p, new Future())\n}\n\n// timeout :: number -> Promise e a -> Promise (e|TimeoutError) a\nexport function timeout (ms, x) {\n const p = resolve(x)\n return isSettled(p) ? p : _timeout(ms, p, new Future())\n}\n\n// -------------------------------------------------------------\n// ## Iterables\n// -------------------------------------------------------------\n\n// any :: Iterable (Promise e a) -> Promise e a\nexport function any (promises) {\n return iterablePromise(new Any(), promises)\n}\n\n// settle :: Iterable (Promise e a) -> Promise e [Promise e a]\nexport function settle (promises) {\n const handler = new Settle(resolve, resultsArray(promises))\n return iterablePromise(handler, promises)\n}\n\n// -------------------------------------------------------------\n// ## Lifting\n// -------------------------------------------------------------\n\n// merge :: (...* -> b) -> ...Promise e a -> Promise e b\nexport function merge (f, ...args) {\n return runMerge(f, this, args)\n}\n\nfunction runMerge (f, thisArg, args) {\n const handler = new Merge(new MergeHandler(f, thisArg), resultsArray(args))\n return iterablePromise(handler, args)\n}\n\nclass MergeHandler {\n constructor (f, c) {\n this.context = pushContext(this.constructor, Merge.name)\n this.f = f\n this.c = c\n this.promise = void 0\n this.args = void 0\n }\n\n merge (promise, args) {\n this.promise = promise\n this.args = args\n taskQueue.add(this)\n }\n\n run () {\n const c = swapContext(this.context)\n try {\n this.promise._resolve(this.f.apply(this.c, this.args))\n } catch (e) {\n this.promise._reject(e)\n }\n swapContext(c)\n }\n}\n\nfunction checkFunction (f) {\n if (typeof f !== 'function') {\n throw new TypeError('must provide a resolver function')\n }\n}\n\n// -------------------------------------------------------------\n// ## ES6 Promise polyfill\n// -------------------------------------------------------------\n\nconst NOARGS = []\n\n// type Resolve a = a -> ()\n// type Reject e = e -> ()\n// Promise :: (Resolve a -> Reject e) -> Promise e a\nclass CreedPromise extends Future {\n constructor (f) {\n super()\n runResolver(_runPromise, f, void 0, NOARGS, this)\n }\n}\n\nCreedPromise.resolve = resolve\nCreedPromise.reject = reject\nCreedPromise.all = all\nCreedPromise.race = race\n\nexport function shim () {\n /* global self */\n const orig = typeof Promise === 'function' && Promise\n\n /* istanbul ignore if */\n if (typeof self !== 'undefined') {\n self.Promise = CreedPromise\n /* istanbul ignore else */\n } else if (typeof global !== 'undefined') {\n global.Promise = CreedPromise\n }\n\n return orig\n}\n\nexport { CreedPromise as Promise }\n\n/* istanbul ignore if */\nif (typeof Promise !== 'function') {\n shim()\n}\n"],"names":["const","let","this","UNHANDLED_REJECTION","noop","super","fl","then","runPromise","runNode","_runNode","_runPromise"],"mappings":"AAAA;AACA,AAAOA,IAAM,OAAO,KAAK,CAAC,IAAI,EAAC;AAC/B,AAAOA,IAAM,SAAS,GAAG,CAAC,IAAI,EAAC;AAC/B,AAAOA,IAAM,QAAQ,IAAI,CAAC,IAAI,EAAC;AAC/B,AAAOA,IAAM,OAAO,KAAK,SAAS,GAAG,SAAQ;AAC7C,AAAOA,IAAM,KAAK,OAAO,CAAC,IAAI,EAAC;;AAE/B,AAAOA,IAAM,OAAO,KAAK,CAAC,IAAI,CAAC;;ACLxB,SAAS,SAAS,EAAE,CAAC,EAAE;EAC5B,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,GAAG,OAAO,IAAI,CAAC;CACjC;;AAED,AAAO,SAAS,WAAW,EAAE,CAAC,EAAE;EAC9B,OAAO,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AC3B,MAAM,IAAI,SAAS,CAAC,kCAAkC,CAAC;GACxD;CACF;;;;;;AAMDA,IAAM,MAAM,GAAG,GAAE;;;;;AAKjB,IAAM,YAAY;EAAgB,qBACrB,EAAE,CAAC,EAAE;IACdK,SAAK,KAAA,CAAC,IAAA,EAAC;IACP,WAAW,CAACM,YAAW,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI,EAAC;GAClD;;;;oDAAA;;;EAJwB,MAK1B,GAAA;;AAED,YAAY,CAAC,OAAO,GAAG,QAAO;AAC9B,YAAY,CAAC,MAAM,GAAG,OAAM;AAC5B,YAAY,CAAC,GAAG,GAAG,IAAG;AACtB,YAAY,CAAC,IAAI,GAAG,KAAI;;AAExB,AAAO,SAAS,IAAI,IAAI;;EAEtBX,IAAM,IAAI,GAAG,OAAO,OAAO,KAAK,UAAU,IAAI,QAAO;;;EAGrD,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;IAC/B,IAAI,CAAC,OAAO,GAAG,aAAY;;GAE5B,MAAM,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACxC,MAAM,CAAC,OAAO,GAAG,aAAY;GAC9B;;EAED,OAAO,IAAI;CACZ;;AAED;AAGA,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;EACjC,IAAI,GAAE;CACP;;;;"} \ No newline at end of file +{"version":3,"file":"creed.es.js","sources":["../src/state.js","../src/inspect.js","../src/env.js","../src/async.js","../src/TaskQueue.js","../src/trace.js","../src/ErrorHandler.js","../src/emitError.js","../src/maybeThenable.js","../src/Action.js","../src/tryCall.js","../src/then.js","../src/finally.js","../src/map.js","../src/bimap.js","../src/chain.js","../src/Race.js","../src/Merge.js","../src/iterable.js","../node_modules/fantasy-land/index.js","../src/Promise.js","../src/delay.js","../src/TimeoutError.js","../src/timeout.js","../src/Any.js","../src/Settle.js","../src/runPromise.js","../src/node.js","../src/coroutine.js","../src/main.js"],"sourcesContent":["/* eslint no-multi-spaces: 0 */\nexport const PENDING = 1 << 0\nexport const FULFILLED = 1 << 1\nexport const REJECTED = 1 << 2\nexport const SETTLED = FULFILLED | REJECTED\nexport const NEVER = 1 << 3\n\nexport const HANDLED = 1 << 4\n","import { PENDING, FULFILLED, REJECTED, SETTLED, NEVER, HANDLED } from './state'\n\nexport function isPending (p) {\n return (p.state() & PENDING) > 0\n}\n\nexport function isFulfilled (p) {\n return (p.state() & FULFILLED) > 0\n}\n\nexport function isRejected (p) {\n return (p.state() & REJECTED) > 0\n}\n\nexport function isSettled (p) {\n return (p.state() & SETTLED) > 0\n}\n\nexport function isNever (p) {\n return (p.state() & NEVER) > 0\n}\n\nexport function isHandled (p) {\n return (p.state() & HANDLED) > 0\n}\n\nexport function getValue (p) {\n const n = p.near()\n if (!isFulfilled(n)) {\n throw new TypeError('getValue called on ' + p)\n }\n\n return n.value\n}\n\nexport function getReason (p) {\n const n = p.near()\n if (!isRejected(n)) {\n throw new TypeError('getReason called on ' + p)\n }\n\n silenceError(n)\n return n.value\n}\n\nexport function silenceError (p) {\n p._runAction(silencer)\n}\n\n// implements Action\nconst silencer = {\n fulfilled () {},\n rejected (p) {\n p._state |= HANDLED\n }\n}\n","/* global process,MutationObserver,WebKitMutationObserver */\n\nconst isNode = typeof process !== 'undefined' &&\n Object.prototype.toString.call(process) === '[object process]'\n\n/* istanbul ignore next */\nconst MutationObs = (typeof MutationObserver === 'function' && MutationObserver) ||\n (typeof WebKitMutationObserver === 'function' && WebKitMutationObserver)\n\nconst getenv = name => isNode && process.env[name]\n\nconst isDebug = getenv('CREED_DEBUG') ||\n getenv('NODE_ENV') === 'development' ||\n getenv('NODE_ENV') === 'test'\n\nexport { isNode, MutationObs, isDebug }\n","import { isNode, MutationObs } from './env'\n\n/* global process,document */\n\nexport default function (f) {\n return isNode ? createNodeScheduler(f) /* istanbul ignore next */\n : MutationObs ? createBrowserScheduler(f)\n : createFallbackScheduler(f)\n}\n\n/* istanbul ignore next */\nfunction createFallbackScheduler (f) {\n return () => setTimeout(f, 0)\n}\n\nfunction createNodeScheduler (f) {\n return () => process.nextTick(f)\n}\n\n/* istanbul ignore next */\nfunction createBrowserScheduler (f) {\n const node = document.createTextNode('')\n new MutationObs(f).observe(node, { characterData: true })\n\n let i = 0\n return () => { node.data = (i ^= 1) }\n}\n","import makeAsync from './async'\n\nexport default class TaskQueue {\n constructor () {\n this.tasks = new Array(2 << 15)\n this.length = 0\n this.drain = makeAsync(() => this._drain())\n }\n\n add (task) {\n if (this.length === 0) {\n this.drain()\n }\n\n this.tasks[this.length++] = task\n }\n\n _drain () {\n const q = this.tasks\n for (let i = 0; i < this.length; ++i) {\n q[i].run()\n q[i] = void 0\n }\n this.length = 0\n }\n}\n","const noop = () => {}\n\n// WARNING: shared mutable notion of \"current context\"\nlet _currentContext\nlet _createContext = noop\n\n// Get the current context\nexport const peekContext = () => _currentContext\n\n// Append a new context to the current, and set the current context\n// to the newly appended one\nexport const pushContext = (at, tag) =>\n _createContext(_currentContext, at, tag)\n\n// Set the current context to the provided one, returning the\n// previously current context (which makes it easy to swap back\n// to it)\nexport const swapContext = context => {\n const previousContext = _currentContext\n _currentContext = context\n return previousContext\n}\n\n// Enable context tracing. Must provide:\n// createContext :: c -> Function -> String -> c\n// Given the current context, and a function and string tag representing a new context,\n// return a new current context\n// initialContext :: c\n// An initial current context\nexport const traceAsync = (createContext, initialContext) => {\n _createContext = createContext\n _currentContext = initialContext\n}\n\n// Enable default context tracing\nexport const enableAsyncTraces = () =>\n traceAsync(createContext, undefined)\n\n// Disable context tracing\nexport const disableAsyncTraces = () =>\n traceAsync(noop, undefined)\n\n// ------------------------------------------------------\n// Default context tracing\n\nexport const createContext = (currentContext, at, tag) =>\n new Context(currentContext, tag || at.name, at)\n\nexport const captureStackTrace = Error.captureStackTrace || noop\n\nexport class Context {\n constructor (next, tag, at) {\n this.next = next\n this.tag = tag\n this.name = tag ? ` from ${tag}:` : ' from previous context:'\n captureStackTrace(this, at)\n }\n\n toString () {\n return this.name\n }\n}\n\n// ------------------------------------------------------\n// Default context formatting\n\n// If context provided, attach an async trace for it.\n// Otherwise, do nothing.\nexport const attachTrace = (e, context) =>\n context != null ? formatTrace(e, context) : e\n\n// If e is an Error, attach an async trace to e for the provided context\n// Otherwise, do nothing\nexport function formatTrace (e, context) {\n if (e instanceof Error && !('_creed$OriginalStack' in e)) {\n e._creed$OriginalStack = e.stack\n e.stack = formatContext(elideTrace(e.stack), context)\n }\n return e\n}\n\n// Fold context list into a newline-separated, combined async trace\nexport function formatContext (trace, context) {\n if (context == null) {\n return trace\n }\n const s = elideTrace(context.stack)\n return formatContext(s.indexOf(' at ') < 0 ? trace : (trace + '\\n' + s), context.next)\n}\n\nexport const elideTraceRx =\n /\\s*at\\s.*(creed[\\\\/](src|dist)[\\\\/]|\\((\\w+|internal[\\\\/].+\\.js)).+:\\d.*/g\n\n// Remove internal stack frames\nexport const elideTrace = stack =>\n typeof stack === 'string' ? stack.replace(elideTraceRx, '') : ''\n","import { silenceError, isHandled } from './inspect'\nimport { attachTrace } from './trace'\n\nconst UNHANDLED_REJECTION = 'unhandledRejection'\nconst HANDLED_REJECTION = 'rejectionHandled'\n\nexport default class ErrorHandler {\n constructor (emitEvent, reportError) {\n this.rejections = []\n this.emit = emitEvent\n this.reportError = reportError\n }\n\n track (rejected) {\n const e = attachTrace(rejected.value, rejected.context)\n\n if (!this.emit(UNHANDLED_REJECTION, rejected, e)) {\n /* istanbul ignore else */\n if (this.rejections.length === 0) {\n setTimeout(reportErrors, 1, this.reportError, this.rejections)\n }\n this.rejections.push(rejected)\n }\n }\n\n untrack (rejected) {\n silenceError(rejected)\n this.emit(HANDLED_REJECTION, rejected)\n }\n}\n\nfunction reportErrors (report, rejections) {\n try {\n reportAll(rejections, report)\n } finally {\n rejections.length = 0\n }\n}\n\nfunction reportAll (rejections, report) {\n for (let i = 0; i < rejections.length; ++i) {\n const rejected = rejections[i]\n /* istanbul ignore else */\n if (!isHandled(rejected)) {\n report(rejected)\n }\n }\n}\n","import { isNode } from './env'\n\nconst UNHANDLED_REJECTION = 'unhandledRejection'\n\nexport default function () {\n /* eslint complexity: [2, 5] */\n /* global process, self, CustomEvent */\n // istanbul ignore else */\n if (isNode && typeof process.emit === 'function') {\n // Returning falsy here means to call the default reportRejection API.\n // This is safe even in browserify since process.emit always returns\n // falsy in browserify:\n // https://github.com/defunctzombie/node-process/blob/master/browser.js#L40-L46\n return function (type, error) {\n return type === UNHANDLED_REJECTION\n ? process.emit(type, error.value, error)\n : process.emit(type, error)\n }\n } else if (typeof self !== 'undefined' && typeof CustomEvent === 'function') {\n return (function (noop, self, CustomEvent) {\n var hasCustomEvent\n try {\n hasCustomEvent = new CustomEvent(UNHANDLED_REJECTION) instanceof CustomEvent\n } catch (e) {\n hasCustomEvent = false\n }\n\n return !hasCustomEvent ? noop : function (type, error) {\n const ev = new CustomEvent(type, {\n detail: {\n reason: error.value,\n promise: error\n },\n bubbles: false,\n cancelable: true\n })\n\n return !self.dispatchEvent(ev)\n }\n }(noop, self, CustomEvent))\n }\n\n // istanbul ignore next */\n return noop\n}\n\n// istanbul ignore next */\nfunction noop () {}\n","// maybeThenable :: * -> boolean\nexport default function maybeThenable (x) {\n return (typeof x === 'object' || typeof x === 'function') && x !== null\n}\n","import { pushContext } from './trace'\n\nexport default class Action {\n constructor (promise) {\n this.promise = promise\n this.context = pushContext(this.constructor)\n }\n\n // default onFulfilled action\n /* istanbul ignore next */\n fulfilled (p) {\n this.promise._become(p)\n }\n\n // default onRejected action\n rejected (p) {\n this.promise._become(p)\n return false\n }\n}\n","export default function tryCall (f, x, handle, promise) {\n let result\n // test if `f` (and only it) throws\n try {\n result = f(x)\n } catch (e) {\n promise._reject(e)\n return\n } // else\n handle(promise, result)\n}\n","import Action from './Action'\nimport tryCall from './tryCall'\n\nexport default function then (f, r, p, promise) {\n p._when(new Then(f, r, promise))\n return promise\n}\n\nclass Then extends Action {\n constructor (f, r, promise) {\n super(promise)\n this.f = f\n this.r = r\n }\n\n fulfilled (p) {\n this.runThen(this.f, p)\n }\n\n rejected (p) {\n return this.runThen(this.r, p)\n }\n\n runThen (f, p) {\n if (typeof f !== 'function') {\n this.promise._become(p)\n return false\n }\n tryCall(f, p.value, handleThen, this.promise)\n return true\n }\n}\n\nfunction handleThen (promise, result) {\n promise._resolve(result)\n}\n","import Action from './Action'\nimport maybeThenable from './maybeThenable'\nimport { isRejected } from './inspect'\n\nexport default function (resolve, f, p, promise) {\n p._when(new Finally(resolve, f, promise))\n return promise\n}\n\nexport class Finally extends Action {\n constructor (resolve, f, promise) {\n super(promise)\n this.resolve = resolve\n this.f = f\n }\n\n fulfilled (p) {\n this.runFinally(this.f, p)\n }\n\n rejected (p) {\n return this.runFinally(this.f, p)\n }\n\n runFinally (f, p) {\n let result\n // test iff `f` throws\n try {\n result = f()\n } catch (e) {\n this.promise._reject(e)\n return true\n }\n return this.handleFinally(p, result)\n }\n\n handleFinally (p, finallyResult) {\n if (maybeThenable(finallyResult)) {\n this.resolve(finallyResult)._when(new DeferredFinally(p, this.promise))\n return true\n }\n\n this.promise._become(p)\n return false\n }\n}\n\nclass DeferredFinally extends Action {\n constructor (result, promise) {\n super(promise)\n this.result = result\n }\n\n fulfilled (p) {\n if (isRejected(this.result)) {\n this.promise._reject(this.result.value)\n return\n }\n this.promise._become(this.result)\n }\n}\n","import Action from './Action'\nimport tryCall from './tryCall'\n\nexport default function (f, p, promise) {\n p._when(new Map(f, promise))\n return promise\n}\n\nexport class Map extends Action {\n constructor (f, promise) {\n super(promise)\n this.f = f\n }\n\n fulfilled (p) {\n tryCall(this.f, p.value, handleMap, this.promise)\n }\n}\n\nfunction handleMap (promise, result) {\n promise._fulfill(result)\n}\n","import { Map } from './map'\nimport tryCall from './tryCall'\n\nexport default function (r, f, p, promise) {\n p._when(new Bimap(r, f, promise))\n return promise\n}\n\nclass Bimap extends Map {\n constructor (r, f, promise) {\n super(f, promise)\n this.r = r\n }\n\n rejected (p) {\n tryCall(this.r, p.value, handleMapRejected, this.promise)\n }\n}\n\nfunction handleMapRejected (promise, result) {\n promise._reject(result)\n}\n","import Action from './Action'\nimport tryCall from './tryCall'\nimport maybeThenable from './maybeThenable'\n\nexport default function (f, p, promise) {\n p._when(new Chain(f, promise))\n return promise\n}\n\nclass Chain extends Action {\n constructor (f, promise) {\n super(promise)\n this.f = f\n }\n\n fulfilled (p) {\n tryCall(this.f, p.value, handleChain, this.promise)\n }\n}\n\nfunction handleChain (promise, result) {\n if (!(maybeThenable(result) && typeof result.then === 'function')) {\n promise._reject(new TypeError('f must return a promise'))\n }\n\n promise._resolve(result)\n}\n","import { silenceError } from './inspect'\n\nexport default class Race {\n valueAt (x, i, promise) {\n promise._fulfill(x)\n }\n\n fulfillAt (p, i, promise) {\n promise._become(p)\n }\n\n rejectAt (p, i, promise) {\n // In the case where the result promise has been resolved\n // need to silence all subsequently seen rejections\n promise._isResolved() ? silenceError(p) : promise._become(p)\n }\n\n complete (total, promise) {\n if (total === 0) {\n promise._become(promise.constructor.empty())\n }\n }\n}\n","import { silenceError } from './inspect'\n\nexport default class Merge {\n constructor (mergeHandler, results) {\n this.pending = 0\n this.results = results\n this.mergeHandler = mergeHandler\n }\n\n valueAt (x, i, promise) {\n this.results[i] = x\n this.check(this.pending - 1, promise)\n }\n\n fulfillAt (p, i, promise) {\n this.valueAt(p.value, i, promise)\n }\n\n rejectAt (p, i, promise) {\n // In the case where the result promise has been resolved\n // need to silence all subsequently seen rejections\n promise._isResolved() ? silenceError(p) : promise._become(p)\n }\n\n complete (total, promise) {\n this.check(this.pending + total, promise)\n }\n\n check (pending, promise) {\n this.pending = pending\n if (pending === 0) {\n this.mergeHandler.merge(promise, this.results)\n }\n }\n}\n","import { isFulfilled, isRejected, silenceError } from './inspect'\nimport Action from './Action'\nimport maybeThenable from './maybeThenable'\n\nexport function resultsArray (iterable) {\n return Array.isArray(iterable) ? new Array(iterable.length) : []\n}\n\nexport function resolveIterable (resolve, handler, promises, promise) {\n const run = Array.isArray(promises) ? runArray : runIterable\n try {\n run(resolve, handler, promises, promise)\n } catch (e) {\n promise._reject(e)\n }\n return promise.near()\n}\n\nfunction runArray (resolve, handler, promises, promise) {\n let i = 0\n\n for (; i < promises.length; ++i) {\n handleItem(resolve, handler, promises[i], i, promise)\n }\n\n handler.complete(i, promise)\n}\n\nfunction runIterable (resolve, handler, promises, promise) {\n let i = 0\n const iter = promises[Symbol.iterator]()\n\n while (true) {\n const step = iter.next()\n if (step.done) {\n break\n }\n handleItem(resolve, handler, step.value, i++, promise)\n }\n\n handler.complete(i, promise)\n}\n\nfunction handleItem (resolve, handler, x, i, promise) {\n /* eslint complexity:[1,6] */\n if (!maybeThenable(x)) {\n handler.valueAt(x, i, promise)\n return\n }\n\n const p = resolve(x)\n\n if (promise._isResolved()) {\n if (!isFulfilled(p)) {\n silenceError(p)\n }\n } else if (isFulfilled(p)) {\n handler.fulfillAt(p, i, promise)\n } else if (isRejected(p)) {\n handler.rejectAt(p, i, promise)\n } else {\n p._runAction(new AtIndex(handler, i, promise))\n }\n}\n\nclass AtIndex extends Action {\n constructor (handler, i, promise) {\n super(promise)\n this.i = i\n this.handler = handler\n }\n\n fulfilled (p) {\n this.handler.fulfillAt(p, this.i, this.promise)\n }\n\n rejected (p) {\n return this.handler.rejectAt(p, this.i, this.promise)\n }\n}\n","(function() {\n\n 'use strict';\n\n /* eslint comma-dangle: [\"off\"], no-var: [\"off\"], strict: [\"error\", \"function\"] */\n /* global self */\n\n var mapping = {\n equals: 'fantasy-land/equals',\n lte: 'fantasy-land/lte',\n compose: 'fantasy-land/compose',\n id: 'fantasy-land/id',\n concat: 'fantasy-land/concat',\n empty: 'fantasy-land/empty',\n invert: 'fantasy-land/invert',\n filter: 'fantasy-land/filter',\n map: 'fantasy-land/map',\n contramap: 'fantasy-land/contramap',\n ap: 'fantasy-land/ap',\n of: 'fantasy-land/of',\n alt: 'fantasy-land/alt',\n zero: 'fantasy-land/zero',\n reduce: 'fantasy-land/reduce',\n traverse: 'fantasy-land/traverse',\n chain: 'fantasy-land/chain',\n chainRec: 'fantasy-land/chainRec',\n extend: 'fantasy-land/extend',\n extract: 'fantasy-land/extract',\n bimap: 'fantasy-land/bimap',\n promap: 'fantasy-land/promap'\n };\n\n if (typeof module === 'object' && typeof module.exports === 'object') {\n module.exports = mapping;\n } else {\n self.FantasyLand = mapping;\n }\n\n}());\n","import TaskQueue from './TaskQueue'\nimport ErrorHandler from './ErrorHandler'\nimport makeEmitError from './emitError'\nimport maybeThenable from './maybeThenable'\nimport { PENDING, FULFILLED, REJECTED, NEVER } from './state'\nimport { isNever, isSettled } from './inspect'\n\nimport then from './then'\nimport _finally from './finally'\nimport map from './map'\nimport bimap from './bimap'\nimport chain from './chain'\n\nimport Race from './Race'\nimport Merge from './Merge'\nimport { resolveIterable, resultsArray } from './iterable'\n\nimport { swapContext, peekContext } from './trace'\n\nimport fl from 'fantasy-land'\n\nconst taskQueue = new TaskQueue()\nexport { taskQueue }\n\n/* istanbul ignore next */\nconst handleError = ({ value }) => { throw value }\n\n/* istanbul ignore next */\nconst errorHandler = new ErrorHandler(makeEmitError(), handleError)\n\n// -------------------------------------------------------------\n// ## Types\n// -------------------------------------------------------------\n\n// Internal base type, provides fantasy-land namespace\n// and type representative\nclass Core {\n constructor () {\n this.context = peekContext()\n }\n // empty :: Promise e a\n static empty () {\n return never()\n }\n\n // of :: a -> Promise e a\n static of (x) {\n return fulfill(x)\n }\n\n static [fl.empty] () {\n return never()\n }\n\n static [fl.of] (x) {\n return fulfill(x)\n }\n\n finally (f) {\n return typeof f === 'function'\n ? _finally(resolve, f, this.near(), new Future())\n : this\n }\n\n [fl.map] (f) {\n return this.map(f)\n }\n\n [fl.bimap] (r, f) {\n return this.bimap(r, f)\n }\n\n [fl.ap] (pf) {\n return pf.ap(this)\n }\n\n [fl.chain] (f) {\n return this.chain(f)\n }\n\n [fl.concat] (p) {\n return this.concat(p)\n }\n\n [fl.alt] (p) {\n return this.or(p)\n }\n\n static [fl.zero] () {\n return never()\n }\n\n // @deprecated The name concat is deprecated, use or() instead.\n concat (b) {\n return this.or(b)\n }\n}\n\n// data Promise e a where\n// Future :: Promise e a\n// Fulfilled :: a -> Promise e a\n// Rejected :: Error e => e -> Promise e a\n// Never :: Promise e a\n\n// Future :: Promise e a\n// A promise whose value cannot be known until some future time\nexport class Future extends Core {\n constructor () {\n super()\n this.ref = void 0\n this.action = void 0\n this.length = 0\n }\n\n // then :: Promise e a -> (a -> b) -> Promise e b\n // then :: Promise e a -> () -> (e -> b) -> Promise e b\n // then :: Promise e a -> (a -> b) -> (e -> b) -> Promise e b\n then (f, r) {\n const n = this.near()\n return n === this ? then(f, r, this, new Future()) : n.then(f, r)\n }\n\n // catch :: Promise e a -> (e -> b) -> Promise e b\n catch (r) {\n const n = this.near()\n return n === this ? then(void 0, r, this, new Future()) : n.catch(r)\n }\n\n // map :: Promise e a -> (a -> b) -> Promise e b\n map (f) {\n const n = this.near()\n return n === this ? map(f, this, new Future()) : n.map(f)\n }\n\n bimap (r, f) {\n const n = this.near()\n return n === this\n ? bimap(r, f, this, new Future())\n : n.bimap(r, f)\n }\n\n // ap :: Promise e (a -> b) -> Promise e a -> Promise e b\n ap (p) {\n const n = this.near()\n const pn = p.near()\n return n === this ? this.chain(f => pn.map(f)) : n.ap(pn)\n }\n\n // chain :: Promise e a -> (a -> Promise e b) -> Promise e b\n chain (f) {\n const n = this.near()\n return n === this ? chain(f, this, new Future()) : n.chain(f)\n }\n\n // or :: Promise e a -> Promise e a -> Promise e a\n or (b) {\n /* eslint complexity:[2,5] */\n const n = this.near()\n const bn = b.near()\n\n return isSettled(n) || isNever(bn) ? n\n : isSettled(bn) || isNever(n) ? bn\n : race([n, bn])\n }\n\n // toString :: Promise e a -> String\n toString () {\n return '[object ' + this.inspect() + ']'\n }\n\n // inspect :: Promise e a -> String\n inspect () {\n const n = this.near()\n return n === this ? 'Promise { pending }' : n.inspect()\n }\n\n // near :: Promise e a -> Promise e a\n near () {\n if (!this._isResolved()) {\n return this\n }\n\n this.ref = this.ref.near()\n return this.ref\n }\n\n // state :: Promise e a -> Int\n state () {\n return this._isResolved() ? this.ref.near().state() : PENDING\n }\n\n _isResolved () {\n return this.ref !== void 0\n }\n\n _when (action) {\n this._runAction(action)\n }\n\n _runAction (action) {\n if (this.action === void 0) {\n this.action = action\n } else {\n this[this.length++] = action\n }\n }\n\n _resolve (x) {\n this._become(resolve(x))\n }\n\n _fulfill (x) {\n this._become(new Fulfilled(x))\n }\n\n _reject (e) {\n if (this._isResolved()) {\n return\n }\n\n this.__become(new Rejected(e))\n }\n\n _become (p) {\n if (this._isResolved()) {\n return\n }\n\n this.__become(p)\n }\n\n __become (p) {\n this.ref = p === this ? cycle() : p\n\n if (this.action === void 0) {\n return\n }\n\n taskQueue.add(this)\n }\n\n run () {\n const p = this.ref.near()\n p._runAction(this.action)\n this.action = void 0\n\n for (let i = 0; i < this.length; ++i) {\n p._runAction(this[i])\n this[i] = void 0\n }\n }\n}\n\n// Fulfilled :: a -> Promise e a\n// A promise whose value is already known\nclass Fulfilled extends Core {\n constructor (x) {\n super()\n this.value = x\n }\n\n then (f) {\n return typeof f === 'function' ? then(f, void 0, this, new Future()) : this\n }\n\n catch () {\n return this\n }\n\n map (f) {\n return map(f, this, new Future())\n }\n\n bimap (_, f) {\n return this.map(f)\n }\n\n ap (p) {\n return p.map(this.value)\n }\n\n chain (f) {\n return chain(f, this, new Future())\n }\n\n or () {\n return this\n }\n\n toString () {\n return '[object ' + this.inspect() + ']'\n }\n\n inspect () {\n return 'Promise { fulfilled: ' + this.value + ' }'\n }\n\n state () {\n return FULFILLED\n }\n\n near () {\n return this\n }\n\n _when (action) {\n taskQueue.add(new Continuation(action, this))\n }\n\n _runAction (action) {\n const c = swapContext(action.context)\n action.fulfilled(this)\n swapContext(c)\n }\n}\n\n// Rejected :: Error e => e -> Promise e a\n// A promise whose value cannot be known due to some reason/error\nclass Rejected extends Core {\n constructor (e) {\n super()\n this.value = e\n this._state = REJECTED\n errorHandler.track(this)\n }\n\n then (_, r) {\n return typeof r === 'function' ? this.catch(r) : this\n }\n\n catch (r) {\n return then(void 0, r, this, new Future())\n }\n\n map () {\n return this\n }\n\n bimap (r) {\n return bimap(r, void 0, this, new Future())\n }\n\n ap () {\n return this\n }\n\n chain () {\n return this\n }\n\n or () {\n return this\n }\n\n toString () {\n return '[object ' + this.inspect() + ']'\n }\n\n inspect () {\n return 'Promise { rejected: ' + this.value + ' }'\n }\n\n state () {\n return this._state\n }\n\n near () {\n return this\n }\n\n _when (action) {\n taskQueue.add(new Continuation(action, this))\n }\n\n _runAction (action) {\n const c = swapContext(action.context)\n if (action.rejected(this)) {\n errorHandler.untrack(this)\n }\n swapContext(c)\n }\n}\n\n// Never :: Promise e a\n// A promise that waits forever for its value to be known\nclass Never extends Core {\n then () {\n return this\n }\n\n catch () {\n return this\n }\n\n finally () {\n return this\n }\n\n map () {\n return this\n }\n\n bimap () {\n return this\n }\n\n ap () {\n return this\n }\n\n chain () {\n return this\n }\n\n or (b) {\n return b\n }\n\n toString () {\n return '[object ' + this.inspect() + ']'\n }\n\n inspect () {\n return 'Promise { never }'\n }\n\n state () {\n return PENDING | NEVER\n }\n\n near () {\n return this\n }\n\n _when () {\n }\n\n _runAction () {\n }\n}\n\n// -------------------------------------------------------------\n// ## Creating promises\n// -------------------------------------------------------------\n\n// resolve :: Thenable e a -> Promise e a\n// resolve :: a -> Promise e a\nexport function resolve (x) {\n return isPromise(x) ? x.near()\n : maybeThenable(x) ? refForMaybeThenable(fulfill, x)\n : new Fulfilled(x)\n}\n\n// reject :: e -> Promise e a\nexport function reject (e) {\n return new Rejected(e)\n}\n\n// never :: Promise e a\nexport function never () {\n return new Never()\n}\n\n// fulfill :: a -> Promise e a\nexport function fulfill (x) {\n return new Fulfilled(x)\n}\n\n// future :: () -> { resolve: Resolve e a, promise: Promise e a }\n// type Resolve e a = a|Thenable e a -> ()\nexport function future () {\n const promise = new Future()\n return {resolve: x => promise._resolve(x), promise}\n}\n\n// -------------------------------------------------------------\n// ## Iterables\n// -------------------------------------------------------------\n\n// all :: Iterable (Promise e a) -> Promise e [a]\nexport function all (promises) {\n const handler = new Merge(allHandler, resultsArray(promises))\n return iterablePromise(handler, promises)\n}\n\nconst allHandler = {\n merge (promise, args) {\n promise._fulfill(args)\n }\n}\n\n// race :: Iterable (Promise e a) -> Promise e a\nexport function race (promises) {\n return iterablePromise(new Race(), promises)\n}\n\nfunction isIterable (x) {\n return typeof x === 'object' && x !== null\n}\n\nexport function iterablePromise (handler, iterable) {\n if (!isIterable(iterable)) {\n return reject(new TypeError('expected an iterable'))\n }\n\n const p = new Future()\n return resolveIterable(resolveMaybeThenable, handler, iterable, p)\n}\n\n// -------------------------------------------------------------\n// # Internals\n// -------------------------------------------------------------\n\n// isPromise :: * -> boolean\nfunction isPromise (x) {\n return x instanceof Core\n}\n\nfunction resolveMaybeThenable (x) {\n return isPromise(x) ? x.near() : refForMaybeThenable(fulfill, x)\n}\n\nfunction refForMaybeThenable (otherwise, x) {\n try {\n const then = x.then\n return typeof then === 'function'\n ? extractThenable(then, x)\n : otherwise(x)\n } catch (e) {\n return new Rejected(e)\n }\n}\n\n// WARNING: Naming the first arg \"then\" triggers babel compilation bug\nfunction extractThenable (thn, thenable) {\n const p = new Future()\n\n try {\n thn.call(thenable, x => p._resolve(x), e => p._reject(e))\n } catch (e) {\n p._reject(e)\n }\n\n return p.near()\n}\n\nfunction cycle () {\n return new Rejected(new TypeError('resolution cycle'))\n}\n\nclass Continuation {\n constructor (action, promise) {\n this.action = action\n this.promise = promise\n }\n\n run () {\n this.promise._runAction(this.action)\n }\n}\n","import Action from './Action'\n\nexport default function (ms, p, promise) {\n p._runAction(new Delay(ms, promise))\n return promise\n}\n\nclass Delay extends Action {\n constructor (time, promise) {\n super(promise)\n this.time = time\n }\n\n fulfilled (p) {\n /* global setTimeout */\n setTimeout(become, this.time, p, this.promise)\n }\n}\n\nfunction become (p, promise) {\n promise._become(p)\n}\n","export default class TimeoutError extends Error {\n constructor (message) {\n super()\n this.message = message\n this.name = TimeoutError.name\n /* istanbul ignore else */\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, TimeoutError)\n }\n }\n}\n","import Action from './Action'\nimport TimeoutError from './TimeoutError'\n\nexport default function (ms, p, promise) {\n const timer = setTimeout(rejectOnTimeout, ms, promise)\n p._runAction(new Timeout(timer, promise))\n return promise\n}\n\nclass Timeout extends Action {\n constructor (timer, promise) {\n super(promise)\n this.timer = timer\n }\n\n fulfilled (p) {\n clearTimeout(this.timer)\n this.promise._become(p)\n }\n\n rejected (p) {\n clearTimeout(this.timer)\n return super.rejected(p)\n }\n}\n\nfunction rejectOnTimeout (promise) {\n promise._reject(new TimeoutError('promise timeout'))\n}\n","import { silenceError } from './inspect.js'\n\nexport default class Any {\n constructor () {\n this.pending = 0\n }\n\n valueAt (x, i, promise) {\n promise._fulfill(x)\n }\n\n fulfillAt (p, i, promise) {\n promise._become(p)\n }\n\n rejectAt (p, i, promise) {\n silenceError(p)\n this.check(this.pending - 1, promise)\n }\n\n complete (total, promise) {\n this.check(this.pending + total, promise)\n }\n\n check (pending, promise) {\n this.pending = pending\n if (pending === 0) {\n promise._reject(new RangeError('No fulfilled promises in input'))\n }\n }\n}\n","import { silenceError } from './inspect'\n\nexport default class Settle {\n constructor (resolve, results) {\n this.pending = 0\n this.results = results\n this.resolve = resolve\n }\n\n valueAt (x, i, promise) {\n this.settleAt(this.resolve(x), i, promise)\n }\n\n fulfillAt (p, i, promise) {\n this.settleAt(p, i, promise)\n }\n\n rejectAt (p, i, promise) {\n silenceError(p)\n this.settleAt(p, i, promise)\n }\n\n settleAt (p, i, promise) {\n this.results[i] = p\n this.check(this.pending - 1, promise)\n }\n\n complete (total, promise) {\n this.check(this.pending + total, promise)\n }\n\n check (pending, promise) {\n this.pending = pending\n if (pending === 0) {\n promise._fulfill(this.results)\n }\n }\n}\n","import { swapContext } from './trace'\n\nexport default function runPromise (f, thisArg, args, promise) {\n /* eslint complexity:[2,5] */\n function resolve (x) {\n const c = swapContext(promise.context)\n promise._resolve(x)\n swapContext(c)\n }\n\n function reject (e) {\n const c = swapContext(promise.context)\n promise._reject(e)\n swapContext(c)\n }\n\n switch (args.length) {\n case 0:\n f.call(thisArg, resolve, reject)\n break\n case 1:\n f.call(thisArg, args[0], resolve, reject)\n break\n case 2:\n f.call(thisArg, args[0], args[1], resolve, reject)\n break\n case 3:\n f.call(thisArg, args[0], args[1], args[2], resolve, reject)\n break\n default:\n args.push(resolve, reject)\n f.apply(thisArg, args)\n }\n\n return promise\n}\n","import { swapContext } from './trace'\n\nexport default function runNode (f, thisArg, args, promise) {\n /* eslint complexity:[2,5] */\n function settleNode (e, x) {\n const c = swapContext(promise.context)\n if (e) {\n promise._reject(e)\n } else {\n promise._fulfill(x)\n }\n swapContext(c)\n }\n\n switch (args.length) {\n case 0:\n f.call(thisArg, settleNode)\n break\n case 1:\n f.call(thisArg, args[0], settleNode)\n break\n case 2:\n f.call(thisArg, args[0], args[1], settleNode)\n break\n case 3:\n f.call(thisArg, args[0], args[1], args[2], settleNode)\n break\n default:\n args.push(settleNode)\n f.apply(thisArg, args)\n }\n\n return promise\n}\n","import Action from './Action'\nimport { swapContext } from './trace'\n\nexport default function (resolve, iterator, promise) {\n new Coroutine(resolve, iterator, promise).run()\n return promise\n}\n\nclass Coroutine extends Action {\n constructor (resolve, iterator, promise) {\n super(promise)\n this.resolve = resolve\n this.generator = iterator\n }\n\n run () {\n this.tryStep(this.generator.next, void 0)\n }\n\n tryStep (resume, x) {\n const context = swapContext(this.context)\n let result\n // test if `resume` (and only it) throws\n try {\n result = resume.call(this.generator, x)\n } catch (e) {\n this.handleReject(e)\n return\n } finally {\n swapContext(context)\n }// else\n\n this.handleResult(result)\n }\n\n handleResult (result) {\n if (result.done) {\n return this.promise._resolve(result.value)\n }\n\n this.resolve(result.value)._when(this)\n }\n\n handleReject (e) {\n this.promise._reject(e)\n }\n\n fulfilled (p) {\n this.tryStep(this.generator.next, p.value)\n }\n\n rejected (p) {\n this.tryStep(this.generator.throw, p.value)\n return true\n }\n}\n","import { isFulfilled, isRejected, isSettled, isPending, isNever, isHandled, getValue, getReason } from './inspect'\nimport { Future, resolve, reject, future, never, fulfill, all, race, iterablePromise, taskQueue } from './Promise'\n\nimport _delay from './delay'\nimport _timeout from './timeout'\n\nimport Any from './Any'\nimport Merge from './Merge'\nimport Settle from './Settle'\nimport { resultsArray } from './iterable'\n\nimport _runPromise from './runPromise'\nimport _runNode from './node'\nimport _runCoroutine from './coroutine.js'\n\nimport { isDebug } from './env'\nimport { swapContext, pushContext, enableAsyncTraces, disableAsyncTraces } from './trace'\n\nexport { enableAsyncTraces, disableAsyncTraces }\n\n/* istanbul ignore next */\nif (isDebug) {\n enableAsyncTraces()\n}\n\n// -------------------------------------------------------------\n// ## Core promise methods\n// -------------------------------------------------------------\n\nexport {\n resolve, reject, future, never, fulfill, all, race,\n isFulfilled, isRejected, isSettled, isPending, isNever, isHandled,\n getValue, getReason\n}\n\n// -------------------------------------------------------------\n// ## Coroutine\n// -------------------------------------------------------------\n\n// coroutine :: Generator e a -> (...* -> Promise e a)\n// Make a coroutine from a promise-yielding generator\nexport function coroutine (generator) {\n return function coroutinified (...args) {\n return runGenerator(generator, this, args)\n }\n}\n\nfunction runGenerator (generator, thisArg, args) {\n const iterator = generator.apply(thisArg, args)\n return _runCoroutine(resolve, iterator, new Future())\n}\n\n// -------------------------------------------------------------\n// ## Node-style async\n// -------------------------------------------------------------\n\n// type Nodeback e a = e -> a -> ()\n// type NodeApi e a = ...* -> Nodeback e a -> ()\n\n// fromNode :: NodeApi e a -> (...args -> Promise e a)\n// Turn a Node API into a promise API\nexport function fromNode (f) {\n return function promisified (...args) {\n return runResolver(_runNode, f, this, args, new Future())\n }\n}\n\n// runNode :: NodeApi e a -> ...* -> Promise e a\n// Run a Node API, returning a promise for the outcome\nexport function runNode (f, ...args) {\n return runResolver(_runNode, f, this, args, new Future())\n}\n\n// -------------------------------------------------------------\n// ## Make a promise\n// -------------------------------------------------------------\n\n// type Resolve e a = a|Thenable e a -> ()\n// type Reject e = e -> ()\n// type Producer e a = (...* -> Resolve e a -> Reject e -> ())\n// runPromise :: Producer e a -> ...* -> Promise e a\nexport function runPromise (f, ...args) {\n return runResolver(_runPromise, f, this, args, new Future())\n}\n\nfunction runResolver (run, f, thisArg, args, p) {\n checkFunction(f)\n\n try {\n run(f, thisArg, args, p)\n } catch (e) {\n p._reject(e)\n }\n\n return p\n}\n\n// -------------------------------------------------------------\n// ## Time\n// -------------------------------------------------------------\n\n// delay :: number -> Promise e a -> Promise e a\nexport function delay (ms, x) {\n /* eslint complexity:[2,4] */\n const p = resolve(x)\n return ms <= 0 || isRejected(p) || isNever(p) ? p\n : _delay(ms, p, new Future())\n}\n\n// timeout :: number -> Promise e a -> Promise (e|TimeoutError) a\nexport function timeout (ms, x) {\n const p = resolve(x)\n return isSettled(p) ? p : _timeout(ms, p, new Future())\n}\n\n// -------------------------------------------------------------\n// ## Iterables\n// -------------------------------------------------------------\n\n// any :: Iterable (Promise e a) -> Promise e a\nexport function any (promises) {\n return iterablePromise(new Any(), promises)\n}\n\n// settle :: Iterable (Promise e a) -> Promise e [Promise e a]\nexport function settle (promises) {\n const handler = new Settle(resolve, resultsArray(promises))\n return iterablePromise(handler, promises)\n}\n\n// -------------------------------------------------------------\n// ## Lifting\n// -------------------------------------------------------------\n\n// merge :: (...* -> b) -> ...Promise e a -> Promise e b\nexport function merge (f, ...args) {\n return runMerge(f, this, args)\n}\n\nfunction runMerge (f, thisArg, args) {\n const handler = new Merge(new MergeHandler(f, thisArg), resultsArray(args))\n return iterablePromise(handler, args)\n}\n\nclass MergeHandler {\n constructor (f, c) {\n this.context = pushContext(this.constructor, Merge.name)\n this.f = f\n this.c = c\n this.promise = void 0\n this.args = void 0\n }\n\n merge (promise, args) {\n this.promise = promise\n this.args = args\n taskQueue.add(this)\n }\n\n run () {\n const c = swapContext(this.context)\n try {\n this.promise._resolve(this.f.apply(this.c, this.args))\n } catch (e) {\n this.promise._reject(e)\n }\n swapContext(c)\n }\n}\n\nfunction checkFunction (f) {\n if (typeof f !== 'function') {\n throw new TypeError('must provide a resolver function')\n }\n}\n\n// -------------------------------------------------------------\n// ## ES6 Promise polyfill\n// -------------------------------------------------------------\n\nconst NOARGS = []\n\n// type Resolve a = a -> ()\n// type Reject e = e -> ()\n// Promise :: (Resolve a -> Reject e) -> Promise e a\nclass CreedPromise extends Future {\n constructor (f) {\n super()\n runResolver(_runPromise, f, void 0, NOARGS, this)\n }\n}\n\nCreedPromise.resolve = resolve\nCreedPromise.reject = reject\nCreedPromise.all = all\nCreedPromise.race = race\n\nexport function shim () {\n /* global self */\n const orig = typeof Promise === 'function' && Promise\n\n /* istanbul ignore if */\n if (typeof self !== 'undefined') {\n self.Promise = CreedPromise\n /* istanbul ignore else */\n } else if (typeof global !== 'undefined') {\n global.Promise = CreedPromise\n }\n\n return orig\n}\n\nexport { CreedPromise as Promise }\n\n/* istanbul ignore if */\nif (typeof Promise !== 'function') {\n shim()\n}\n"],"names":["const","let","this","UNHANDLED_REJECTION","noop","super","fl","then","_runNode","runNode","runPromise","_runPromise"],"mappings":"AAAA;AACA,AAAOA,IAAM,OAAO,KAAK,CAAC,IAAI,EAAC;AAC/B,AAAOA,IAAM,SAAS,GAAG,CAAC,IAAI,EAAC;AAC/B,AAAOA,IAAM,QAAQ,IAAI,CAAC,IAAI,EAAC;AAC/B,AAAOA,IAAM,OAAO,KAAK,SAAS,GAAG,SAAQ;AAC7C,AAAOA,IAAM,KAAK,OAAO,CAAC,IAAI,EAAC;;AAE/B,AAAOA,IAAM,OAAO,KAAK,CAAC,IAAI,CAAC;;ACLxB,SAAS,SAAS,EAAE,CAAC,EAAE;EAC5B,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,GAAG,OAAO,IAAI,CAAC;CACjC;;AAED,AAAO,SAAS,WAAW,EAAE,CAAC,EAAE;EAC9B,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,GAAG,SAAS,IAAI,CAAC;CACnC;;AAED,AAA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F;;;;;;AAMDA,IAAM,MAAM,GAAG,GAAE;;;;;AAKjB,IAAM,YAAY;EAChB,qBAAW,EAAE,CAAC,EAAE;IACdK,cAAK,KAAC,EAAC;IACP,WAAW,CAACM,UAAW,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI,EAAC;;;;;;;;EAH1B,SAK1B;;AAED,YAAY,CAAC,OAAO,GAAG,QAAO;AAC9B,YAAY,CAAC,MAAM,GAAG,OAAM;AAC5B,YAAY,CAAC,GAAG,GAAG,IAAG;AACtB,YAAY,CAAC,IAAI,GAAG,KAAI;;AAExB,AAAO,SAAS,IAAI,IAAI;;EAEtBX,IAAM,IAAI,GAAG,OAAO,OAAO,KAAK,UAAU,IAAI,QAAO;;;EAGrD,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;IAC/B,IAAI,CAAC,OAAO,GAAG,aAAY;;GAE5B,MAAM,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACxC,MAAM,CAAC,OAAO,GAAG,aAAY;GAC9B;;EAED,OAAO,IAAI;CACZ;;AAED;AAGA,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;EACjC,IAAI,GAAE;CACP;;;;"} \ No newline at end of file diff --git a/dist/creed.js b/dist/creed.js index fb2adda..3ecc04f 100644 --- a/dist/creed.js +++ b/dist/creed.js @@ -85,11 +85,11 @@ var isDebug = getenv('CREED_DEBUG') || /* global process,document */ -var makeAsync = function (f) { +function makeAsync (f) { return isNode ? createNodeScheduler(f) /* istanbul ignore next */ : MutationObs ? createBrowserScheduler(f) : createFallbackScheduler(f) -}; +} /* istanbul ignore next */ function createFallbackScheduler (f) { @@ -183,11 +183,12 @@ var captureStackTrace = Error.captureStackTrace || noop; var Context = function Context (next, tag, at) { this.next = next; this.tag = tag; + this.name = tag ? (" from " + tag + ":") : ' from previous context:'; captureStackTrace(this, at); }; Context.prototype.toString = function toString () { - return this.tag ? (" from " + (this.tag) + ":") : ' from previous context:' + return this.name }; // ------------------------------------------------------ @@ -217,7 +218,7 @@ function formatContext (trace, context) { } var elideTraceRx = - /\s*at\s.*(creed[\\/](src|dist)[\\/]|internal[\\/]process[\\/]|\((timers|module)\.js).+:\d.*/g; + /\s*at\s.*(creed[\\/](src|dist)[\\/]|\((\w+|internal[\\/].+\.js)).+:\d.*/g; // Remove internal stack frames var elideTrace = function (stack) { return typeof stack === 'string' ? stack.replace(elideTraceRx, '') : ''; }; @@ -268,7 +269,8 @@ function reportAll (rejections, report) { var UNHANDLED_REJECTION$1 = 'unhandledRejection'; -var makeEmitError = function () { +function makeEmitError () { + /* eslint complexity: [2, 5] */ /* global process, self, CustomEvent */ // istanbul ignore else */ if (isNode && typeof process.emit === 'function') { @@ -307,7 +309,7 @@ var makeEmitError = function () { // istanbul ignore next */ return noop$1 -}; +} // istanbul ignore next */ function noop$1 () {} @@ -386,10 +388,80 @@ function handleThen (promise, result) { promise._resolve(result); } -var map = function (f, p, promise) { +function _finally (resolve, f, p, promise) { + p._when(new Finally(resolve, f, promise)); + return promise +} + +var Finally = (function (Action$$1) { + function Finally (resolve, f, promise) { + Action$$1.call(this, promise); + this.resolve = resolve; + this.f = f; + } + + if ( Action$$1 ) Finally.__proto__ = Action$$1; + Finally.prototype = Object.create( Action$$1 && Action$$1.prototype ); + Finally.prototype.constructor = Finally; + + Finally.prototype.fulfilled = function fulfilled (p) { + this.runFinally(this.f, p); + }; + + Finally.prototype.rejected = function rejected (p) { + return this.runFinally(this.f, p) + }; + + Finally.prototype.runFinally = function runFinally (f, p) { + var result; + // test iff `f` throws + try { + result = f(); + } catch (e) { + this.promise._reject(e); + return true + } + return this.handleFinally(p, result) + }; + + Finally.prototype.handleFinally = function handleFinally (p, finallyResult) { + if (maybeThenable(finallyResult)) { + this.resolve(finallyResult)._when(new DeferredFinally(p, this.promise)); + return true + } + + this.promise._become(p); + return false + }; + + return Finally; +}(Action)); + +var DeferredFinally = (function (Action$$1) { + function DeferredFinally (result, promise) { + Action$$1.call(this, promise); + this.result = result; + } + + if ( Action$$1 ) DeferredFinally.__proto__ = Action$$1; + DeferredFinally.prototype = Object.create( Action$$1 && Action$$1.prototype ); + DeferredFinally.prototype.constructor = DeferredFinally; + + DeferredFinally.prototype.fulfilled = function fulfilled (p) { + if (isRejected(this.result)) { + this.promise._reject(this.result.value); + return + } + this.promise._become(this.result); + }; + + return DeferredFinally; +}(Action)); + +function map (f, p, promise) { p._when(new Map(f, promise)); return promise -}; +} var Map = (function (Action$$1) { function Map (f, promise) { @@ -412,10 +484,10 @@ function handleMap (promise, result) { promise._fulfill(result); } -var bimap = function (r, f, p, promise) { +function bimap (r, f, p, promise) { p._when(new Bimap(r, f, promise)); return promise -}; +} var Bimap = (function (Map$$1) { function Bimap (r, f, promise) { @@ -438,10 +510,10 @@ function handleMapRejected (promise, result) { promise._reject(result); } -var chain = function (f, p, promise) { +function chain (f, p, promise) { p._when(new Chain(f, promise)); return promise -}; +} var Chain = (function (Action$$1) { function Chain (f, promise) { @@ -612,11 +684,6 @@ function createCommonjsModule(fn, module) { var fantasyLand = createCommonjsModule(function (module) { (function() { - 'use strict'; - - /* eslint comma-dangle: ["off"], no-var: ["off"], strict: ["error", "function"] */ - /* global self */ - var mapping = { equals: 'fantasy-land/equals', lte: 'fantasy-land/lte', @@ -625,6 +692,7 @@ var fantasyLand = createCommonjsModule(function (module) { concat: 'fantasy-land/concat', empty: 'fantasy-land/empty', invert: 'fantasy-land/invert', + filter: 'fantasy-land/filter', map: 'fantasy-land/map', contramap: 'fantasy-land/contramap', ap: 'fantasy-land/ap', @@ -684,6 +752,12 @@ Core[fantasyLand.of] = function (x) { return fulfill(x) }; +Core.prototype.finally = function finally$1 (f) { + return typeof f === 'function' + ? _finally(resolve, f, this.near(), new Future()) + : this +}; + Core.prototype[fantasyLand.map] = function (f) { return this.map(f) }; @@ -1041,6 +1115,10 @@ var Never = (function (Core) { return this }; + Never.prototype.finally = function finally$2 () { + return this + }; + Never.prototype.map = function map$$1 () { return this }; @@ -1204,10 +1282,10 @@ Continuation.prototype.run = function run () { this.promise._runAction(this.action); }; -var _delay = function (ms, p, promise) { +function _delay (ms, p, promise) { p._runAction(new Delay(ms, promise)); return promise -}; +} var Delay = (function (Action$$1) { function Delay (time, promise) { @@ -1249,11 +1327,11 @@ var TimeoutError = (function (Error) { return TimeoutError; }(Error)); -var _timeout = function (ms, p, promise) { +function _timeout (ms, p, promise) { var timer = setTimeout(rejectOnTimeout, ms, promise); p._runAction(new Timeout(timer, promise)); return promise -}; +} var Timeout = (function (Action$$1) { function Timeout (timer, promise) { @@ -1345,7 +1423,7 @@ Settle.prototype.check = function check (pending, promise) { } }; -function runPromise$1 (f, thisArg, args, promise) { +function runPromise (f, thisArg, args, promise) { /* eslint complexity:[2,5] */ function resolve (x) { var c = swapContext(promise.context); @@ -1380,7 +1458,7 @@ function runPromise$1 (f, thisArg, args, promise) { return promise } -function runNode$1 (f, thisArg, args, promise) { +function runNode (f, thisArg, args, promise) { /* eslint complexity:[2,5] */ function settleNode (e, x) { var c = swapContext(promise.context); @@ -1413,10 +1491,10 @@ function runNode$1 (f, thisArg, args, promise) { return promise } -var _runCoroutine = function (resolve, iterator, promise) { +function _runCoroutine (resolve, iterator, promise) { new Coroutine(resolve, iterator, promise).run(); return promise -}; +} var Coroutine = (function (Action$$1) { function Coroutine (resolve, iterator, promise) { @@ -1512,17 +1590,17 @@ function fromNode (f) { var args = [], len = arguments.length; while ( len-- ) args[ len ] = arguments[ len ]; - return runResolver(runNode$1, f, this, args, new Future()) + return runResolver(runNode, f, this, args, new Future()) } } // runNode :: NodeApi e a -> ...* -> Promise e a // Run a Node API, returning a promise for the outcome -function runNode (f) { +function runNode$1 (f) { var args = [], len = arguments.length - 1; while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ]; - return runResolver(runNode$1, f, this, args, new Future()) + return runResolver(runNode, f, this, args, new Future()) } // ------------------------------------------------------------- @@ -1533,11 +1611,11 @@ function runNode (f) { // type Reject e = e -> () // type Producer e a = (...* -> Resolve e a -> Reject e -> ()) // runPromise :: Producer e a -> ...* -> Promise e a -function runPromise (f) { +function runPromise$1 (f) { var args = [], len = arguments.length - 1; while ( len-- > 0 ) args[ len ] = arguments[ len + 1 ]; - return runResolver(runPromise$1, f, this, args, new Future()) + return runResolver(runPromise, f, this, args, new Future()) } function runResolver (run, f, thisArg, args, p) { @@ -1644,7 +1722,7 @@ var NOARGS = []; var CreedPromise = (function (Future$$1) { function CreedPromise (f) { Future$$1.call(this); - runResolver(runPromise$1, f, void 0, NOARGS, this); + runResolver(runPromise, f, void 0, NOARGS, this); } if ( Future$$1 ) CreedPromise.__proto__ = Future$$1; @@ -1698,8 +1776,8 @@ exports.getValue = getValue; exports.getReason = getReason; exports.coroutine = coroutine; exports.fromNode = fromNode; -exports.runNode = runNode; -exports.runPromise = runPromise; +exports.runNode = runNode$1; +exports.runPromise = runPromise$1; exports.delay = delay; exports.timeout = timeout; exports.any = any; diff --git a/dist/creed.js.map b/dist/creed.js.map index f91a6ce..041620d 100644 --- a/dist/creed.js.map +++ b/dist/creed.js.map @@ -1 +1 @@ -{"version":3,"file":"creed.js","sources":["../src/state.js","../src/inspect.js","../src/env.js","../src/async.js","../src/TaskQueue.js","../src/trace.js","../src/ErrorHandler.js","../src/emitError.js","../src/maybeThenable.js","../src/Action.js","../src/tryCall.js","../src/then.js","../src/map.js","../src/bimap.js","../src/chain.js","../src/Race.js","../src/Merge.js","../src/iterable.js","../node_modules/fantasy-land/index.js","../src/Promise.js","../src/delay.js","../src/TimeoutError.js","../src/timeout.js","../src/Any.js","../src/Settle.js","../src/runPromise.js","../src/node.js","../src/coroutine.js","../src/main.js"],"sourcesContent":["/* eslint no-multi-spaces: 0 */\nexport const PENDING = 1 << 0\nexport const FULFILLED = 1 << 1\nexport const REJECTED = 1 << 2\nexport const SETTLED = FULFILLED | REJECTED\nexport const NEVER = 1 << 3\n\nexport const HANDLED = 1 << 4\n","import { PENDING, FULFILLED, REJECTED, SETTLED, NEVER, HANDLED } from './state'\n\nexport function isPending (p) {\n return (p.state() & PENDING) > 0\n}\n\nexport function isFulfilled (p) {\n return (p.state() & FULFILLED) > 0\n}\n\nexport function isRejected (p) {\n return (p.state() & REJECTED) > 0\n}\n\nexport function isSettled (p) {\n return (p.state() & SETTLED) > 0\n}\n\nexport function isNever (p) {\n return (p.state() & NEVER) > 0\n}\n\nexport function isHandled (p) {\n return (p.state() & HANDLED) > 0\n}\n\nexport function getValue (p) {\n const n = p.near()\n if (!isFulfilled(n)) {\n throw new TypeError('getValue called on ' + p)\n }\n\n return n.value\n}\n\nexport function getReason (p) {\n const n = p.near()\n if (!isRejected(n)) {\n throw new TypeError('getReason called on ' + p)\n }\n\n silenceError(n)\n return n.value\n}\n\nexport function silenceError (p) {\n p._runAction(silencer)\n}\n\n// implements Action\nconst silencer = {\n fulfilled () {},\n rejected (p) {\n p._state |= HANDLED\n }\n}\n","/* global process,MutationObserver,WebKitMutationObserver */\n\nconst isNode = typeof process !== 'undefined' &&\n Object.prototype.toString.call(process) === '[object process]'\n\n/* istanbul ignore next */\nconst MutationObs = (typeof MutationObserver === 'function' && MutationObserver) ||\n (typeof WebKitMutationObserver === 'function' && WebKitMutationObserver)\n\nconst getenv = name => isNode && process.env[name]\n\nconst isDebug = getenv('CREED_DEBUG') ||\n getenv('NODE_ENV') === 'development' ||\n getenv('NODE_ENV') === 'test'\n\nexport { isNode, MutationObs, isDebug }\n","import { isNode, MutationObs } from './env'\n\n/* global process,document */\n\nexport default function (f) {\n return isNode ? createNodeScheduler(f) /* istanbul ignore next */\n : MutationObs ? createBrowserScheduler(f)\n : createFallbackScheduler(f)\n}\n\n/* istanbul ignore next */\nfunction createFallbackScheduler (f) {\n return () => setTimeout(f, 0)\n}\n\nfunction createNodeScheduler (f) {\n return () => process.nextTick(f)\n}\n\n/* istanbul ignore next */\nfunction createBrowserScheduler (f) {\n const node = document.createTextNode('')\n new MutationObs(f).observe(node, { characterData: true })\n\n let i = 0\n return () => { node.data = (i ^= 1) }\n}\n","import makeAsync from './async'\n\nexport default class TaskQueue {\n constructor () {\n this.tasks = new Array(2 << 15)\n this.length = 0\n this.drain = makeAsync(() => this._drain())\n }\n\n add (task) {\n if (this.length === 0) {\n this.drain()\n }\n\n this.tasks[this.length++] = task\n }\n\n _drain () {\n const q = this.tasks\n for (let i = 0; i < this.length; ++i) {\n q[i].run()\n q[i] = void 0\n }\n this.length = 0\n }\n}\n","const noop = () => {}\n\n// WARNING: shared mutable notion of \"current context\"\nlet _currentContext\nlet _createContext = noop\n\n// Get the current context\nexport const peekContext = () => _currentContext\n\n// Append a new context to the current, and set the current context\n// to the newly appended one\nexport const pushContext = (at, tag) =>\n _createContext(_currentContext, at, tag)\n\n// Set the current context to the provided one, returning the\n// previously current context (which makes it easy to swap back\n// to it)\nexport const swapContext = context => {\n const previousContext = _currentContext\n _currentContext = context\n return previousContext\n}\n\n// Enable context tracing. Must provide:\n// createContext :: c -> Function -> String -> c\n// Given the current context, and a function and string tag representing a new context,\n// return a new current context\n// initialContext :: c\n// An initial current context\nexport const traceAsync = (createContext, initialContext) => {\n _createContext = createContext\n _currentContext = initialContext\n}\n\n// Enable default context tracing\nexport const enableAsyncTraces = () =>\n traceAsync(createContext, undefined)\n\n// Disable context tracing\nexport const disableAsyncTraces = () =>\n traceAsync(noop, undefined)\n\n// ------------------------------------------------------\n// Default context tracing\n\nexport const createContext = (currentContext, at, tag) =>\n new Context(currentContext, tag || at.name, at)\n\nexport const captureStackTrace = Error.captureStackTrace || noop\n\nexport class Context {\n constructor (next, tag, at) {\n this.next = next\n this.tag = tag\n captureStackTrace(this, at)\n }\n\n toString () {\n return this.tag ? ` from ${this.tag}:` : ' from previous context:'\n }\n}\n\n// ------------------------------------------------------\n// Default context formatting\n\n// If context provided, attach an async trace for it.\n// Otherwise, do nothing.\nexport const attachTrace = (e, context) =>\n context != null ? formatTrace(e, context) : e\n\n// If e is an Error, attach an async trace to e for the provided context\n// Otherwise, do nothing\nexport function formatTrace (e, context) {\n if (e instanceof Error && !('_creed$OriginalStack' in e)) {\n e._creed$OriginalStack = e.stack\n e.stack = formatContext(elideTrace(e.stack), context)\n }\n return e\n}\n\n// Fold context list into a newline-separated, combined async trace\nexport function formatContext (trace, context) {\n if (context == null) {\n return trace\n }\n const s = elideTrace(context.stack)\n return formatContext(s.indexOf(' at ') < 0 ? trace : (trace + '\\n' + s), context.next)\n}\n\nexport const elideTraceRx =\n /\\s*at\\s.*(creed[\\\\/](src|dist)[\\\\/]|internal[\\\\/]process[\\\\/]|\\((timers|module)\\.js).+:\\d.*/g\n\n// Remove internal stack frames\nexport const elideTrace = stack =>\n typeof stack === 'string' ? stack.replace(elideTraceRx, '') : ''\n","import { silenceError, isHandled } from './inspect'\nimport { attachTrace } from './trace'\n\nconst UNHANDLED_REJECTION = 'unhandledRejection'\nconst HANDLED_REJECTION = 'rejectionHandled'\n\nexport default class ErrorHandler {\n constructor (emitEvent, reportError) {\n this.rejections = []\n this.emit = emitEvent\n this.reportError = reportError\n }\n\n track (rejected) {\n const e = attachTrace(rejected.value, rejected.context)\n\n if (!this.emit(UNHANDLED_REJECTION, rejected, e)) {\n /* istanbul ignore else */\n if (this.rejections.length === 0) {\n setTimeout(reportErrors, 1, this.reportError, this.rejections)\n }\n this.rejections.push(rejected)\n }\n }\n\n untrack (rejected) {\n silenceError(rejected)\n this.emit(HANDLED_REJECTION, rejected)\n }\n}\n\nfunction reportErrors (report, rejections) {\n try {\n reportAll(rejections, report)\n } finally {\n rejections.length = 0\n }\n}\n\nfunction reportAll (rejections, report) {\n for (let i = 0; i < rejections.length; ++i) {\n const rejected = rejections[i]\n /* istanbul ignore else */\n if (!isHandled(rejected)) {\n report(rejected)\n }\n }\n}\n","import { isNode } from './env'\n\nconst UNHANDLED_REJECTION = 'unhandledRejection'\n\nexport default function () {\n /* global process, self, CustomEvent */\n // istanbul ignore else */\n if (isNode && typeof process.emit === 'function') {\n // Returning falsy here means to call the default reportRejection API.\n // This is safe even in browserify since process.emit always returns\n // falsy in browserify:\n // https://github.com/defunctzombie/node-process/blob/master/browser.js#L40-L46\n return function (type, error) {\n return type === UNHANDLED_REJECTION\n ? process.emit(type, error.value, error)\n : process.emit(type, error)\n }\n } else if (typeof self !== 'undefined' && typeof CustomEvent === 'function') {\n return (function (noop, self, CustomEvent) {\n var hasCustomEvent\n try {\n hasCustomEvent = new CustomEvent(UNHANDLED_REJECTION) instanceof CustomEvent\n } catch (e) {\n hasCustomEvent = false\n }\n\n return !hasCustomEvent ? noop : function (type, error) {\n const ev = new CustomEvent(type, {\n detail: {\n reason: error.value,\n promise: error\n },\n bubbles: false,\n cancelable: true\n })\n\n return !self.dispatchEvent(ev)\n }\n }(noop, self, CustomEvent))\n }\n\n // istanbul ignore next */\n return noop\n}\n\n// istanbul ignore next */\nfunction noop () {}\n","// maybeThenable :: * -> boolean\nexport default function maybeThenable (x) {\n return (typeof x === 'object' || typeof x === 'function') && x !== null\n}\n","import { pushContext } from './trace'\n\nexport default class Action {\n constructor (promise) {\n this.promise = promise\n this.context = pushContext(this.constructor)\n }\n\n // default onFulfilled action\n /* istanbul ignore next */\n fulfilled (p) {\n this.promise._become(p)\n }\n\n // default onRejected action\n rejected (p) {\n this.promise._become(p)\n return false\n }\n}\n","export default function tryCall (f, x, handle, promise) {\n let result\n // test if `f` (and only it) throws\n try {\n result = f(x)\n } catch (e) {\n promise._reject(e)\n return\n } // else\n handle(promise, result)\n}\n","import Action from './Action'\nimport tryCall from './tryCall'\n\nexport default function then (f, r, p, promise) {\n p._when(new Then(f, r, promise))\n return promise\n}\n\nclass Then extends Action {\n constructor (f, r, promise) {\n super(promise)\n this.f = f\n this.r = r\n }\n\n fulfilled (p) {\n this.runThen(this.f, p)\n }\n\n rejected (p) {\n return this.runThen(this.r, p)\n }\n\n runThen (f, p) {\n if (typeof f !== 'function') {\n this.promise._become(p)\n return false\n }\n tryCall(f, p.value, handleThen, this.promise)\n return true\n }\n}\n\nfunction handleThen (promise, result) {\n promise._resolve(result)\n}\n","import Action from './Action'\nimport tryCall from './tryCall'\n\nexport default function (f, p, promise) {\n p._when(new Map(f, promise))\n return promise\n}\n\nexport class Map extends Action {\n constructor (f, promise) {\n super(promise)\n this.f = f\n }\n\n fulfilled (p) {\n tryCall(this.f, p.value, handleMap, this.promise)\n }\n}\n\nfunction handleMap (promise, result) {\n promise._fulfill(result)\n}\n","import { Map } from './map'\nimport tryCall from './tryCall'\n\nexport default function (r, f, p, promise) {\n p._when(new Bimap(r, f, promise))\n return promise\n}\n\nclass Bimap extends Map {\n constructor (r, f, promise) {\n super(f, promise)\n this.r = r\n }\n\n rejected (p) {\n tryCall(this.r, p.value, handleMapRejected, this.promise)\n }\n}\n\nfunction handleMapRejected (promise, result) {\n promise._reject(result)\n}\n","import Action from './Action'\nimport tryCall from './tryCall'\nimport maybeThenable from './maybeThenable'\n\nexport default function (f, p, promise) {\n p._when(new Chain(f, promise))\n return promise\n}\n\nclass Chain extends Action {\n constructor (f, promise) {\n super(promise)\n this.f = f\n }\n\n fulfilled (p) {\n tryCall(this.f, p.value, handleChain, this.promise)\n }\n}\n\nfunction handleChain (promise, result) {\n if (!(maybeThenable(result) && typeof result.then === 'function')) {\n promise._reject(new TypeError('f must return a promise'))\n }\n\n promise._resolve(result)\n}\n","import { silenceError } from './inspect'\n\nexport default class Race {\n valueAt (x, i, promise) {\n promise._fulfill(x)\n }\n\n fulfillAt (p, i, promise) {\n promise._become(p)\n }\n\n rejectAt (p, i, promise) {\n // In the case where the result promise has been resolved\n // need to silence all subsequently seen rejections\n promise._isResolved() ? silenceError(p) : promise._become(p)\n }\n\n complete (total, promise) {\n if (total === 0) {\n promise._become(promise.constructor.empty())\n }\n }\n}\n","import { silenceError } from './inspect'\n\nexport default class Merge {\n constructor (mergeHandler, results) {\n this.pending = 0\n this.results = results\n this.mergeHandler = mergeHandler\n }\n\n valueAt (x, i, promise) {\n this.results[i] = x\n this.check(this.pending - 1, promise)\n }\n\n fulfillAt (p, i, promise) {\n this.valueAt(p.value, i, promise)\n }\n\n rejectAt (p, i, promise) {\n // In the case where the result promise has been resolved\n // need to silence all subsequently seen rejections\n promise._isResolved() ? silenceError(p) : promise._become(p)\n }\n\n complete (total, promise) {\n this.check(this.pending + total, promise)\n }\n\n check (pending, promise) {\n this.pending = pending\n if (pending === 0) {\n this.mergeHandler.merge(promise, this.results)\n }\n }\n}\n","import { isFulfilled, isRejected, silenceError } from './inspect'\nimport Action from './Action'\nimport maybeThenable from './maybeThenable'\n\nexport function resultsArray (iterable) {\n return Array.isArray(iterable) ? new Array(iterable.length) : []\n}\n\nexport function resolveIterable (resolve, handler, promises, promise) {\n const run = Array.isArray(promises) ? runArray : runIterable\n try {\n run(resolve, handler, promises, promise)\n } catch (e) {\n promise._reject(e)\n }\n return promise.near()\n}\n\nfunction runArray (resolve, handler, promises, promise) {\n let i = 0\n\n for (; i < promises.length; ++i) {\n handleItem(resolve, handler, promises[i], i, promise)\n }\n\n handler.complete(i, promise)\n}\n\nfunction runIterable (resolve, handler, promises, promise) {\n let i = 0\n const iter = promises[Symbol.iterator]()\n\n while (true) {\n const step = iter.next()\n if (step.done) {\n break\n }\n handleItem(resolve, handler, step.value, i++, promise)\n }\n\n handler.complete(i, promise)\n}\n\nfunction handleItem (resolve, handler, x, i, promise) {\n /* eslint complexity:[1,6] */\n if (!maybeThenable(x)) {\n handler.valueAt(x, i, promise)\n return\n }\n\n const p = resolve(x)\n\n if (promise._isResolved()) {\n if (!isFulfilled(p)) {\n silenceError(p)\n }\n } else if (isFulfilled(p)) {\n handler.fulfillAt(p, i, promise)\n } else if (isRejected(p)) {\n handler.rejectAt(p, i, promise)\n } else {\n p._runAction(new AtIndex(handler, i, promise))\n }\n}\n\nclass AtIndex extends Action {\n constructor (handler, i, promise) {\n super(promise)\n this.i = i\n this.handler = handler\n }\n\n fulfilled (p) {\n this.handler.fulfillAt(p, this.i, this.promise)\n }\n\n rejected (p) {\n return this.handler.rejectAt(p, this.i, this.promise)\n }\n}\n","(function() {\n\n 'use strict';\n\n /* eslint comma-dangle: [\"off\"], no-var: [\"off\"], strict: [\"error\", \"function\"] */\n /* global self */\n\n var mapping = {\n equals: 'fantasy-land/equals',\n lte: 'fantasy-land/lte',\n compose: 'fantasy-land/compose',\n id: 'fantasy-land/id',\n concat: 'fantasy-land/concat',\n empty: 'fantasy-land/empty',\n invert: 'fantasy-land/invert',\n map: 'fantasy-land/map',\n contramap: 'fantasy-land/contramap',\n ap: 'fantasy-land/ap',\n of: 'fantasy-land/of',\n alt: 'fantasy-land/alt',\n zero: 'fantasy-land/zero',\n reduce: 'fantasy-land/reduce',\n traverse: 'fantasy-land/traverse',\n chain: 'fantasy-land/chain',\n chainRec: 'fantasy-land/chainRec',\n extend: 'fantasy-land/extend',\n extract: 'fantasy-land/extract',\n bimap: 'fantasy-land/bimap',\n promap: 'fantasy-land/promap'\n };\n\n if (typeof module === 'object' && typeof module.exports === 'object') {\n module.exports = mapping;\n } else {\n self.FantasyLand = mapping;\n }\n\n}());\n","import TaskQueue from './TaskQueue'\nimport ErrorHandler from './ErrorHandler'\nimport makeEmitError from './emitError'\nimport maybeThenable from './maybeThenable'\nimport { PENDING, FULFILLED, REJECTED, NEVER } from './state'\nimport { isNever, isSettled } from './inspect'\n\nimport then from './then'\nimport map from './map'\nimport bimap from './bimap'\nimport chain from './chain'\n\nimport Race from './Race'\nimport Merge from './Merge'\nimport { resolveIterable, resultsArray } from './iterable'\n\nimport { swapContext, peekContext } from './trace'\n\nimport fl from 'fantasy-land'\n\nconst taskQueue = new TaskQueue()\nexport { taskQueue }\n\n/* istanbul ignore next */\nconst handleError = ({ value }) => { throw value }\n\n/* istanbul ignore next */\nconst errorHandler = new ErrorHandler(makeEmitError(), handleError)\n\n// -------------------------------------------------------------\n// ## Types\n// -------------------------------------------------------------\n\n// Internal base type, provides fantasy-land namespace\n// and type representative\nclass Core {\n constructor () {\n this.context = peekContext()\n }\n // empty :: Promise e a\n static empty () {\n return never()\n }\n\n // of :: a -> Promise e a\n static of (x) {\n return fulfill(x)\n }\n\n static [fl.empty] () {\n return never()\n }\n\n static [fl.of] (x) {\n return fulfill(x)\n }\n\n [fl.map] (f) {\n return this.map(f)\n }\n\n [fl.bimap] (r, f) {\n return this.bimap(r, f)\n }\n\n [fl.ap] (pf) {\n return pf.ap(this)\n }\n\n [fl.chain] (f) {\n return this.chain(f)\n }\n\n [fl.concat] (p) {\n return this.concat(p)\n }\n\n [fl.alt] (p) {\n return this.or(p)\n }\n\n static [fl.zero] () {\n return never()\n }\n\n // @deprecated The name concat is deprecated, use or() instead.\n concat (b) {\n return this.or(b)\n }\n}\n\n// data Promise e a where\n// Future :: Promise e a\n// Fulfilled :: a -> Promise e a\n// Rejected :: Error e => e -> Promise e a\n// Never :: Promise e a\n\n// Future :: Promise e a\n// A promise whose value cannot be known until some future time\nexport class Future extends Core {\n constructor () {\n super()\n this.ref = void 0\n this.action = void 0\n this.length = 0\n }\n\n // then :: Promise e a -> (a -> b) -> Promise e b\n // then :: Promise e a -> () -> (e -> b) -> Promise e b\n // then :: Promise e a -> (a -> b) -> (e -> b) -> Promise e b\n then (f, r) {\n const n = this.near()\n return n === this ? then(f, r, this, new Future()) : n.then(f, r)\n }\n\n // catch :: Promise e a -> (e -> b) -> Promise e b\n catch (r) {\n const n = this.near()\n return n === this ? then(void 0, r, this, new Future()) : n.catch(r)\n }\n\n // map :: Promise e a -> (a -> b) -> Promise e b\n map (f) {\n const n = this.near()\n return n === this ? map(f, this, new Future()) : n.map(f)\n }\n\n bimap (r, f) {\n const n = this.near()\n return n === this\n ? bimap(r, f, this, new Future())\n : n.bimap(r, f)\n }\n\n // ap :: Promise e (a -> b) -> Promise e a -> Promise e b\n ap (p) {\n const n = this.near()\n const pn = p.near()\n return n === this ? this.chain(f => pn.map(f)) : n.ap(pn)\n }\n\n // chain :: Promise e a -> (a -> Promise e b) -> Promise e b\n chain (f) {\n const n = this.near()\n return n === this ? chain(f, this, new Future()) : n.chain(f)\n }\n\n // or :: Promise e a -> Promise e a -> Promise e a\n or (b) {\n /* eslint complexity:[2,5] */\n const n = this.near()\n const bn = b.near()\n\n return isSettled(n) || isNever(bn) ? n\n : isSettled(bn) || isNever(n) ? bn\n : race([n, bn])\n }\n\n // toString :: Promise e a -> String\n toString () {\n return '[object ' + this.inspect() + ']'\n }\n\n // inspect :: Promise e a -> String\n inspect () {\n const n = this.near()\n return n === this ? 'Promise { pending }' : n.inspect()\n }\n\n // near :: Promise e a -> Promise e a\n near () {\n if (!this._isResolved()) {\n return this\n }\n\n this.ref = this.ref.near()\n return this.ref\n }\n\n // state :: Promise e a -> Int\n state () {\n return this._isResolved() ? this.ref.near().state() : PENDING\n }\n\n _isResolved () {\n return this.ref !== void 0\n }\n\n _when (action) {\n this._runAction(action)\n }\n\n _runAction (action) {\n if (this.action === void 0) {\n this.action = action\n } else {\n this[this.length++] = action\n }\n }\n\n _resolve (x) {\n this._become(resolve(x))\n }\n\n _fulfill (x) {\n this._become(new Fulfilled(x))\n }\n\n _reject (e) {\n if (this._isResolved()) {\n return\n }\n\n this.__become(new Rejected(e))\n }\n\n _become (p) {\n if (this._isResolved()) {\n return\n }\n\n this.__become(p)\n }\n\n __become (p) {\n this.ref = p === this ? cycle() : p\n\n if (this.action === void 0) {\n return\n }\n\n taskQueue.add(this)\n }\n\n run () {\n const p = this.ref.near()\n p._runAction(this.action)\n this.action = void 0\n\n for (let i = 0; i < this.length; ++i) {\n p._runAction(this[i])\n this[i] = void 0\n }\n }\n}\n\n// Fulfilled :: a -> Promise e a\n// A promise whose value is already known\nclass Fulfilled extends Core {\n constructor (x) {\n super()\n this.value = x\n }\n\n then (f) {\n return typeof f === 'function' ? then(f, void 0, this, new Future()) : this\n }\n\n catch () {\n return this\n }\n\n map (f) {\n return map(f, this, new Future())\n }\n\n bimap (_, f) {\n return this.map(f)\n }\n\n ap (p) {\n return p.map(this.value)\n }\n\n chain (f) {\n return chain(f, this, new Future())\n }\n\n or () {\n return this\n }\n\n toString () {\n return '[object ' + this.inspect() + ']'\n }\n\n inspect () {\n return 'Promise { fulfilled: ' + this.value + ' }'\n }\n\n state () {\n return FULFILLED\n }\n\n near () {\n return this\n }\n\n _when (action) {\n taskQueue.add(new Continuation(action, this))\n }\n\n _runAction (action) {\n const c = swapContext(action.context)\n action.fulfilled(this)\n swapContext(c)\n }\n}\n\n// Rejected :: Error e => e -> Promise e a\n// A promise whose value cannot be known due to some reason/error\nclass Rejected extends Core {\n constructor (e) {\n super()\n this.value = e\n this._state = REJECTED\n errorHandler.track(this)\n }\n\n then (_, r) {\n return typeof r === 'function' ? this.catch(r) : this\n }\n\n catch (r) {\n return then(void 0, r, this, new Future())\n }\n\n map () {\n return this\n }\n\n bimap (r) {\n return bimap(r, void 0, this, new Future())\n }\n\n ap () {\n return this\n }\n\n chain () {\n return this\n }\n\n or () {\n return this\n }\n\n toString () {\n return '[object ' + this.inspect() + ']'\n }\n\n inspect () {\n return 'Promise { rejected: ' + this.value + ' }'\n }\n\n state () {\n return this._state\n }\n\n near () {\n return this\n }\n\n _when (action) {\n taskQueue.add(new Continuation(action, this))\n }\n\n _runAction (action) {\n const c = swapContext(action.context)\n if (action.rejected(this)) {\n errorHandler.untrack(this)\n }\n swapContext(c)\n }\n}\n\n// Never :: Promise e a\n// A promise that waits forever for its value to be known\nclass Never extends Core {\n then () {\n return this\n }\n\n catch () {\n return this\n }\n\n map () {\n return this\n }\n\n bimap () {\n return this\n }\n\n ap () {\n return this\n }\n\n chain () {\n return this\n }\n\n or (b) {\n return b\n }\n\n toString () {\n return '[object ' + this.inspect() + ']'\n }\n\n inspect () {\n return 'Promise { never }'\n }\n\n state () {\n return PENDING | NEVER\n }\n\n near () {\n return this\n }\n\n _when () {\n }\n\n _runAction () {\n }\n}\n\n// -------------------------------------------------------------\n// ## Creating promises\n// -------------------------------------------------------------\n\n// resolve :: Thenable e a -> Promise e a\n// resolve :: a -> Promise e a\nexport function resolve (x) {\n return isPromise(x) ? x.near()\n : maybeThenable(x) ? refForMaybeThenable(fulfill, x)\n : new Fulfilled(x)\n}\n\n// reject :: e -> Promise e a\nexport function reject (e) {\n return new Rejected(e)\n}\n\n// never :: Promise e a\nexport function never () {\n return new Never()\n}\n\n// fulfill :: a -> Promise e a\nexport function fulfill (x) {\n return new Fulfilled(x)\n}\n\n// future :: () -> { resolve: Resolve e a, promise: Promise e a }\n// type Resolve e a = a|Thenable e a -> ()\nexport function future () {\n const promise = new Future()\n return {resolve: x => promise._resolve(x), promise}\n}\n\n// -------------------------------------------------------------\n// ## Iterables\n// -------------------------------------------------------------\n\n// all :: Iterable (Promise e a) -> Promise e [a]\nexport function all (promises) {\n const handler = new Merge(allHandler, resultsArray(promises))\n return iterablePromise(handler, promises)\n}\n\nconst allHandler = {\n merge (promise, args) {\n promise._fulfill(args)\n }\n}\n\n// race :: Iterable (Promise e a) -> Promise e a\nexport function race (promises) {\n return iterablePromise(new Race(), promises)\n}\n\nfunction isIterable (x) {\n return typeof x === 'object' && x !== null\n}\n\nexport function iterablePromise (handler, iterable) {\n if (!isIterable(iterable)) {\n return reject(new TypeError('expected an iterable'))\n }\n\n const p = new Future()\n return resolveIterable(resolveMaybeThenable, handler, iterable, p)\n}\n\n// -------------------------------------------------------------\n// # Internals\n// -------------------------------------------------------------\n\n// isPromise :: * -> boolean\nfunction isPromise (x) {\n return x instanceof Core\n}\n\nfunction resolveMaybeThenable (x) {\n return isPromise(x) ? x.near() : refForMaybeThenable(fulfill, x)\n}\n\nfunction refForMaybeThenable (otherwise, x) {\n try {\n const then = x.then\n return typeof then === 'function'\n ? extractThenable(then, x)\n : otherwise(x)\n } catch (e) {\n return new Rejected(e)\n }\n}\n\n// WARNING: Naming the first arg \"then\" triggers babel compilation bug\nfunction extractThenable (thn, thenable) {\n const p = new Future()\n\n try {\n thn.call(thenable, x => p._resolve(x), e => p._reject(e))\n } catch (e) {\n p._reject(e)\n }\n\n return p.near()\n}\n\nfunction cycle () {\n return new Rejected(new TypeError('resolution cycle'))\n}\n\nclass Continuation {\n constructor (action, promise) {\n this.action = action\n this.promise = promise\n }\n\n run () {\n this.promise._runAction(this.action)\n }\n}\n","import Action from './Action'\n\nexport default function (ms, p, promise) {\n p._runAction(new Delay(ms, promise))\n return promise\n}\n\nclass Delay extends Action {\n constructor (time, promise) {\n super(promise)\n this.time = time\n }\n\n fulfilled (p) {\n /* global setTimeout */\n setTimeout(become, this.time, p, this.promise)\n }\n}\n\nfunction become (p, promise) {\n promise._become(p)\n}\n","export default class TimeoutError extends Error {\n constructor (message) {\n super()\n this.message = message\n this.name = TimeoutError.name\n /* istanbul ignore else */\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, TimeoutError)\n }\n }\n}\n","import Action from './Action'\nimport TimeoutError from './TimeoutError'\n\nexport default function (ms, p, promise) {\n const timer = setTimeout(rejectOnTimeout, ms, promise)\n p._runAction(new Timeout(timer, promise))\n return promise\n}\n\nclass Timeout extends Action {\n constructor (timer, promise) {\n super(promise)\n this.timer = timer\n }\n\n fulfilled (p) {\n clearTimeout(this.timer)\n this.promise._become(p)\n }\n\n rejected (p) {\n clearTimeout(this.timer)\n return super.rejected(p)\n }\n}\n\nfunction rejectOnTimeout (promise) {\n promise._reject(new TimeoutError('promise timeout'))\n}\n","import { silenceError } from './inspect.js'\n\nexport default class Any {\n constructor () {\n this.pending = 0\n }\n\n valueAt (x, i, promise) {\n promise._fulfill(x)\n }\n\n fulfillAt (p, i, promise) {\n promise._become(p)\n }\n\n rejectAt (p, i, promise) {\n silenceError(p)\n this.check(this.pending - 1, promise)\n }\n\n complete (total, promise) {\n this.check(this.pending + total, promise)\n }\n\n check (pending, promise) {\n this.pending = pending\n if (pending === 0) {\n promise._reject(new RangeError('No fulfilled promises in input'))\n }\n }\n}\n","import { silenceError } from './inspect'\n\nexport default class Settle {\n constructor (resolve, results) {\n this.pending = 0\n this.results = results\n this.resolve = resolve\n }\n\n valueAt (x, i, promise) {\n this.settleAt(this.resolve(x), i, promise)\n }\n\n fulfillAt (p, i, promise) {\n this.settleAt(p, i, promise)\n }\n\n rejectAt (p, i, promise) {\n silenceError(p)\n this.settleAt(p, i, promise)\n }\n\n settleAt (p, i, promise) {\n this.results[i] = p\n this.check(this.pending - 1, promise)\n }\n\n complete (total, promise) {\n this.check(this.pending + total, promise)\n }\n\n check (pending, promise) {\n this.pending = pending\n if (pending === 0) {\n promise._fulfill(this.results)\n }\n }\n}\n","import { swapContext } from './trace'\n\nexport default function runPromise (f, thisArg, args, promise) {\n /* eslint complexity:[2,5] */\n function resolve (x) {\n const c = swapContext(promise.context)\n promise._resolve(x)\n swapContext(c)\n }\n\n function reject (e) {\n const c = swapContext(promise.context)\n promise._reject(e)\n swapContext(c)\n }\n\n switch (args.length) {\n case 0:\n f.call(thisArg, resolve, reject)\n break\n case 1:\n f.call(thisArg, args[0], resolve, reject)\n break\n case 2:\n f.call(thisArg, args[0], args[1], resolve, reject)\n break\n case 3:\n f.call(thisArg, args[0], args[1], args[2], resolve, reject)\n break\n default:\n args.push(resolve, reject)\n f.apply(thisArg, args)\n }\n\n return promise\n}\n","import { swapContext } from './trace'\n\nexport default function runNode (f, thisArg, args, promise) {\n /* eslint complexity:[2,5] */\n function settleNode (e, x) {\n const c = swapContext(promise.context)\n if (e) {\n promise._reject(e)\n } else {\n promise._fulfill(x)\n }\n swapContext(c)\n }\n\n switch (args.length) {\n case 0:\n f.call(thisArg, settleNode)\n break\n case 1:\n f.call(thisArg, args[0], settleNode)\n break\n case 2:\n f.call(thisArg, args[0], args[1], settleNode)\n break\n case 3:\n f.call(thisArg, args[0], args[1], args[2], settleNode)\n break\n default:\n args.push(settleNode)\n f.apply(thisArg, args)\n }\n\n return promise\n}\n","import Action from './Action'\nimport { swapContext } from './trace'\n\nexport default function (resolve, iterator, promise) {\n new Coroutine(resolve, iterator, promise).run()\n return promise\n}\n\nclass Coroutine extends Action {\n constructor (resolve, iterator, promise) {\n super(promise)\n this.resolve = resolve\n this.generator = iterator\n }\n\n run () {\n this.tryStep(this.generator.next, void 0)\n }\n\n tryStep (resume, x) {\n const context = swapContext(this.context)\n let result\n // test if `resume` (and only it) throws\n try {\n result = resume.call(this.generator, x)\n } catch (e) {\n this.handleReject(e)\n return\n } finally {\n swapContext(context)\n }// else\n\n this.handleResult(result)\n }\n\n handleResult (result) {\n if (result.done) {\n return this.promise._resolve(result.value)\n }\n\n this.resolve(result.value)._when(this)\n }\n\n handleReject (e) {\n this.promise._reject(e)\n }\n\n fulfilled (p) {\n this.tryStep(this.generator.next, p.value)\n }\n\n rejected (p) {\n this.tryStep(this.generator.throw, p.value)\n return true\n }\n}\n","import { isFulfilled, isRejected, isSettled, isPending, isNever, isHandled, getValue, getReason } from './inspect'\nimport { Future, resolve, reject, future, never, fulfill, all, race, iterablePromise, taskQueue } from './Promise'\n\nimport _delay from './delay'\nimport _timeout from './timeout'\n\nimport Any from './Any'\nimport Merge from './Merge'\nimport Settle from './Settle'\nimport { resultsArray } from './iterable'\n\nimport _runPromise from './runPromise'\nimport _runNode from './node'\nimport _runCoroutine from './coroutine.js'\n\nimport { isDebug } from './env'\nimport { swapContext, pushContext, enableAsyncTraces, disableAsyncTraces } from './trace'\n\nexport { enableAsyncTraces, disableAsyncTraces }\n\n/* istanbul ignore next */\nif (isDebug) {\n enableAsyncTraces()\n}\n\n// -------------------------------------------------------------\n// ## Core promise methods\n// -------------------------------------------------------------\n\nexport {\n resolve, reject, future, never, fulfill, all, race,\n isFulfilled, isRejected, isSettled, isPending, isNever, isHandled,\n getValue, getReason\n}\n\n// -------------------------------------------------------------\n// ## Coroutine\n// -------------------------------------------------------------\n\n// coroutine :: Generator e a -> (...* -> Promise e a)\n// Make a coroutine from a promise-yielding generator\nexport function coroutine (generator) {\n return function coroutinified (...args) {\n return runGenerator(generator, this, args)\n }\n}\n\nfunction runGenerator (generator, thisArg, args) {\n const iterator = generator.apply(thisArg, args)\n return _runCoroutine(resolve, iterator, new Future())\n}\n\n// -------------------------------------------------------------\n// ## Node-style async\n// -------------------------------------------------------------\n\n// type Nodeback e a = e -> a -> ()\n// type NodeApi e a = ...* -> Nodeback e a -> ()\n\n// fromNode :: NodeApi e a -> (...args -> Promise e a)\n// Turn a Node API into a promise API\nexport function fromNode (f) {\n return function promisified (...args) {\n return runResolver(_runNode, f, this, args, new Future())\n }\n}\n\n// runNode :: NodeApi e a -> ...* -> Promise e a\n// Run a Node API, returning a promise for the outcome\nexport function runNode (f, ...args) {\n return runResolver(_runNode, f, this, args, new Future())\n}\n\n// -------------------------------------------------------------\n// ## Make a promise\n// -------------------------------------------------------------\n\n// type Resolve e a = a|Thenable e a -> ()\n// type Reject e = e -> ()\n// type Producer e a = (...* -> Resolve e a -> Reject e -> ())\n// runPromise :: Producer e a -> ...* -> Promise e a\nexport function runPromise (f, ...args) {\n return runResolver(_runPromise, f, this, args, new Future())\n}\n\nfunction runResolver (run, f, thisArg, args, p) {\n checkFunction(f)\n\n try {\n run(f, thisArg, args, p)\n } catch (e) {\n p._reject(e)\n }\n\n return p\n}\n\n// -------------------------------------------------------------\n// ## Time\n// -------------------------------------------------------------\n\n// delay :: number -> Promise e a -> Promise e a\nexport function delay (ms, x) {\n /* eslint complexity:[2,4] */\n const p = resolve(x)\n return ms <= 0 || isRejected(p) || isNever(p) ? p\n : _delay(ms, p, new Future())\n}\n\n// timeout :: number -> Promise e a -> Promise (e|TimeoutError) a\nexport function timeout (ms, x) {\n const p = resolve(x)\n return isSettled(p) ? p : _timeout(ms, p, new Future())\n}\n\n// -------------------------------------------------------------\n// ## Iterables\n// -------------------------------------------------------------\n\n// any :: Iterable (Promise e a) -> Promise e a\nexport function any (promises) {\n return iterablePromise(new Any(), promises)\n}\n\n// settle :: Iterable (Promise e a) -> Promise e [Promise e a]\nexport function settle (promises) {\n const handler = new Settle(resolve, resultsArray(promises))\n return iterablePromise(handler, promises)\n}\n\n// -------------------------------------------------------------\n// ## Lifting\n// -------------------------------------------------------------\n\n// merge :: (...* -> b) -> ...Promise e a -> Promise e b\nexport function merge (f, ...args) {\n return runMerge(f, this, args)\n}\n\nfunction runMerge (f, thisArg, args) {\n const handler = new Merge(new MergeHandler(f, thisArg), resultsArray(args))\n return iterablePromise(handler, args)\n}\n\nclass MergeHandler {\n constructor (f, c) {\n this.context = pushContext(this.constructor, Merge.name)\n this.f = f\n this.c = c\n this.promise = void 0\n this.args = void 0\n }\n\n merge (promise, args) {\n this.promise = promise\n this.args = args\n taskQueue.add(this)\n }\n\n run () {\n const c = swapContext(this.context)\n try {\n this.promise._resolve(this.f.apply(this.c, this.args))\n } catch (e) {\n this.promise._reject(e)\n }\n swapContext(c)\n }\n}\n\nfunction checkFunction (f) {\n if (typeof f !== 'function') {\n throw new TypeError('must provide a resolver function')\n }\n}\n\n// -------------------------------------------------------------\n// ## ES6 Promise polyfill\n// -------------------------------------------------------------\n\nconst NOARGS = []\n\n// type Resolve a = a -> ()\n// type Reject e = e -> ()\n// Promise :: (Resolve a -> Reject e) -> Promise e a\nclass CreedPromise extends Future {\n constructor (f) {\n super()\n runResolver(_runPromise, f, void 0, NOARGS, this)\n }\n}\n\nCreedPromise.resolve = resolve\nCreedPromise.reject = reject\nCreedPromise.all = all\nCreedPromise.race = race\n\nexport function shim () {\n /* global self */\n const orig = typeof Promise === 'function' && Promise\n\n /* istanbul ignore if */\n if (typeof self !== 'undefined') {\n self.Promise = CreedPromise\n /* istanbul ignore else */\n } else if (typeof global !== 'undefined') {\n global.Promise = CreedPromise\n }\n\n return orig\n}\n\nexport { CreedPromise as Promise }\n\n/* istanbul ignore if */\nif (typeof Promise !== 'function') {\n shim()\n}\n"],"names":["const","let","this","UNHANDLED_REJECTION","noop","super","fl","then","runPromise","runNode","_runNode","_runPromise"],"mappings":";;;;;;AAAA;AACA,AAAOA,IAAM,OAAO,KAAK,CAAC,IAAI,EAAC;AAC/B,AAAOA,IAAM,SAAS,GAAG,CAAC,IAAI,EAAC;AAC/B,AAAOA,IAAM,QAAQ,IAAI,CAAC,IAAI,EAAC;AAC/B,AAAOA,IAAM,OAAO,KAAK,SAAS,GAAG,SAAQ;AAC7C,AAAOA,IAAM,KAAK,OAAO,CAAC,IAAI,E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,CAAC,EAAC;GACvD,CAAC,OAAO,CAAC,EAAE;IACZ,IAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EAAC;GACxB;EACH,WAAa,CAAC,CAAC,EAAC;CACf,CAAA;;AAGH,SAAS,aAAa,EAAE,CAAC,EAAE;EACzB,IAAI,OAAO,CAAC,KAAK,UAAU,EAAE;IAC3B,MAAM,IAAI,SAAS,CAAC,kCAAkC,CAAC;GACxD;CACF;;;;;;AAMDA,IAAM,MAAM,GAAG,GAAE;;;;;AAKjB,IAAM,YAAY;EAAgB,qBACrB,EAAE,CAAC,EAAE;IACdK,SAAK,KAAA,CAAC,IAAA,EAAC;IACP,WAAW,CAACM,YAAW,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI,EAAC;GAClD;;;;oDAAA;;;EAJwB,MAK1B,GAAA;;AAED,YAAY,CAAC,OAAO,GAAG,QAAO;AAC9B,YAAY,CAAC,MAAM,GAAG,OAAM;AAC5B,YAAY,CAAC,GAAG,GAAG,IAAG;AACtB,YAAY,CAAC,IAAI,GAAG,KAAI;;AAExB,AAAO,SAAS,IAAI,IAAI;;EAEtBX,IAAM,IAAI,GAAG,OAAO,OAAO,KAAK,UAAU,IAAI,QAAO;;;EAGrD,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;IAC/B,IAAI,CAAC,OAAO,GAAG,aAAY;;GAE5B,MAAM,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACxC,MAAM,CAAC,OAAO,GAAG,aAAY;GAC9B;;EAED,OAAO,IAAI;CACZ;;AAED;AAGA,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;EACjC,IAAI,GAAE;CACP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"creed.js","sources":["../src/state.js","../src/inspect.js","../src/env.js","../src/async.js","../src/TaskQueue.js","../src/trace.js","../src/ErrorHandler.js","../src/emitError.js","../src/maybeThenable.js","../src/Action.js","../src/tryCall.js","../src/then.js","../src/finally.js","../src/map.js","../src/bimap.js","../src/chain.js","../src/Race.js","../src/Merge.js","../src/iterable.js","../node_modules/fantasy-land/index.js","../src/Promise.js","../src/delay.js","../src/TimeoutError.js","../src/timeout.js","../src/Any.js","../src/Settle.js","../src/runPromise.js","../src/node.js","../src/coroutine.js","../src/main.js"],"sourcesContent":["/* eslint no-multi-spaces: 0 */\nexport const PENDING = 1 << 0\nexport const FULFILLED = 1 << 1\nexport const REJECTED = 1 << 2\nexport const SETTLED = FULFILLED | REJECTED\nexport const NEVER = 1 << 3\n\nexport const HANDLED = 1 << 4\n","import { PENDING, FULFILLED, REJECTED, SETTLED, NEVER, HANDLED } from './state'\n\nexport function isPending (p) {\n return (p.state() & PENDING) > 0\n}\n\nexport function isFulfilled (p) {\n return (p.state() & FULFILLED) > 0\n}\n\nexport function isRejected (p) {\n return (p.state() & REJECTED) > 0\n}\n\nexport function isSettled (p) {\n return (p.state() & SETTLED) > 0\n}\n\nexport function isNever (p) {\n return (p.state() & NEVER) > 0\n}\n\nexport function isHandled (p) {\n return (p.state() & HANDLED) > 0\n}\n\nexport function getValue (p) {\n const n = p.near()\n if (!isFulfilled(n)) {\n throw new TypeError('getValue called on ' + p)\n }\n\n return n.value\n}\n\nexport function getReason (p) {\n const n = p.near()\n if (!isRejected(n)) {\n throw new TypeError('getReason called on ' + p)\n }\n\n silenceError(n)\n return n.value\n}\n\nexport function silenceError (p) {\n p._runAction(silencer)\n}\n\n// implements Action\nconst silencer = {\n fulfilled () {},\n rejected (p) {\n p._state |= HANDLED\n }\n}\n","/* global process,MutationObserver,WebKitMutationObserver */\n\nconst isNode = typeof process !== 'undefined' &&\n Object.prototype.toString.call(process) === '[object process]'\n\n/* istanbul ignore next */\nconst MutationObs = (typeof MutationObserver === 'function' && MutationObserver) ||\n (typeof WebKitMutationObserver === 'function' && WebKitMutationObserver)\n\nconst getenv = name => isNode && process.env[name]\n\nconst isDebug = getenv('CREED_DEBUG') ||\n getenv('NODE_ENV') === 'development' ||\n getenv('NODE_ENV') === 'test'\n\nexport { isNode, MutationObs, isDebug }\n","import { isNode, MutationObs } from './env'\n\n/* global process,document */\n\nexport default function (f) {\n return isNode ? createNodeScheduler(f) /* istanbul ignore next */\n : MutationObs ? createBrowserScheduler(f)\n : createFallbackScheduler(f)\n}\n\n/* istanbul ignore next */\nfunction createFallbackScheduler (f) {\n return () => setTimeout(f, 0)\n}\n\nfunction createNodeScheduler (f) {\n return () => process.nextTick(f)\n}\n\n/* istanbul ignore next */\nfunction createBrowserScheduler (f) {\n const node = document.createTextNode('')\n new MutationObs(f).observe(node, { characterData: true })\n\n let i = 0\n return () => { node.data = (i ^= 1) }\n}\n","import makeAsync from './async'\n\nexport default class TaskQueue {\n constructor () {\n this.tasks = new Array(2 << 15)\n this.length = 0\n this.drain = makeAsync(() => this._drain())\n }\n\n add (task) {\n if (this.length === 0) {\n this.drain()\n }\n\n this.tasks[this.length++] = task\n }\n\n _drain () {\n const q = this.tasks\n for (let i = 0; i < this.length; ++i) {\n q[i].run()\n q[i] = void 0\n }\n this.length = 0\n }\n}\n","const noop = () => {}\n\n// WARNING: shared mutable notion of \"current context\"\nlet _currentContext\nlet _createContext = noop\n\n// Get the current context\nexport const peekContext = () => _currentContext\n\n// Append a new context to the current, and set the current context\n// to the newly appended one\nexport const pushContext = (at, tag) =>\n _createContext(_currentContext, at, tag)\n\n// Set the current context to the provided one, returning the\n// previously current context (which makes it easy to swap back\n// to it)\nexport const swapContext = context => {\n const previousContext = _currentContext\n _currentContext = context\n return previousContext\n}\n\n// Enable context tracing. Must provide:\n// createContext :: c -> Function -> String -> c\n// Given the current context, and a function and string tag representing a new context,\n// return a new current context\n// initialContext :: c\n// An initial current context\nexport const traceAsync = (createContext, initialContext) => {\n _createContext = createContext\n _currentContext = initialContext\n}\n\n// Enable default context tracing\nexport const enableAsyncTraces = () =>\n traceAsync(createContext, undefined)\n\n// Disable context tracing\nexport const disableAsyncTraces = () =>\n traceAsync(noop, undefined)\n\n// ------------------------------------------------------\n// Default context tracing\n\nexport const createContext = (currentContext, at, tag) =>\n new Context(currentContext, tag || at.name, at)\n\nexport const captureStackTrace = Error.captureStackTrace || noop\n\nexport class Context {\n constructor (next, tag, at) {\n this.next = next\n this.tag = tag\n this.name = tag ? ` from ${tag}:` : ' from previous context:'\n captureStackTrace(this, at)\n }\n\n toString () {\n return this.name\n }\n}\n\n// ------------------------------------------------------\n// Default context formatting\n\n// If context provided, attach an async trace for it.\n// Otherwise, do nothing.\nexport const attachTrace = (e, context) =>\n context != null ? formatTrace(e, context) : e\n\n// If e is an Error, attach an async trace to e for the provided context\n// Otherwise, do nothing\nexport function formatTrace (e, context) {\n if (e instanceof Error && !('_creed$OriginalStack' in e)) {\n e._creed$OriginalStack = e.stack\n e.stack = formatContext(elideTrace(e.stack), context)\n }\n return e\n}\n\n// Fold context list into a newline-separated, combined async trace\nexport function formatContext (trace, context) {\n if (context == null) {\n return trace\n }\n const s = elideTrace(context.stack)\n return formatContext(s.indexOf(' at ') < 0 ? trace : (trace + '\\n' + s), context.next)\n}\n\nexport const elideTraceRx =\n /\\s*at\\s.*(creed[\\\\/](src|dist)[\\\\/]|\\((\\w+|internal[\\\\/].+\\.js)).+:\\d.*/g\n\n// Remove internal stack frames\nexport const elideTrace = stack =>\n typeof stack === 'string' ? stack.replace(elideTraceRx, '') : ''\n","import { silenceError, isHandled } from './inspect'\nimport { attachTrace } from './trace'\n\nconst UNHANDLED_REJECTION = 'unhandledRejection'\nconst HANDLED_REJECTION = 'rejectionHandled'\n\nexport default class ErrorHandler {\n constructor (emitEvent, reportError) {\n this.rejections = []\n this.emit = emitEvent\n this.reportError = reportError\n }\n\n track (rejected) {\n const e = attachTrace(rejected.value, rejected.context)\n\n if (!this.emit(UNHANDLED_REJECTION, rejected, e)) {\n /* istanbul ignore else */\n if (this.rejections.length === 0) {\n setTimeout(reportErrors, 1, this.reportError, this.rejections)\n }\n this.rejections.push(rejected)\n }\n }\n\n untrack (rejected) {\n silenceError(rejected)\n this.emit(HANDLED_REJECTION, rejected)\n }\n}\n\nfunction reportErrors (report, rejections) {\n try {\n reportAll(rejections, report)\n } finally {\n rejections.length = 0\n }\n}\n\nfunction reportAll (rejections, report) {\n for (let i = 0; i < rejections.length; ++i) {\n const rejected = rejections[i]\n /* istanbul ignore else */\n if (!isHandled(rejected)) {\n report(rejected)\n }\n }\n}\n","import { isNode } from './env'\n\nconst UNHANDLED_REJECTION = 'unhandledRejection'\n\nexport default function () {\n /* eslint complexity: [2, 5] */\n /* global process, self, CustomEvent */\n // istanbul ignore else */\n if (isNode && typeof process.emit === 'function') {\n // Returning falsy here means to call the default reportRejection API.\n // This is safe even in browserify since process.emit always returns\n // falsy in browserify:\n // https://github.com/defunctzombie/node-process/blob/master/browser.js#L40-L46\n return function (type, error) {\n return type === UNHANDLED_REJECTION\n ? process.emit(type, error.value, error)\n : process.emit(type, error)\n }\n } else if (typeof self !== 'undefined' && typeof CustomEvent === 'function') {\n return (function (noop, self, CustomEvent) {\n var hasCustomEvent\n try {\n hasCustomEvent = new CustomEvent(UNHANDLED_REJECTION) instanceof CustomEvent\n } catch (e) {\n hasCustomEvent = false\n }\n\n return !hasCustomEvent ? noop : function (type, error) {\n const ev = new CustomEvent(type, {\n detail: {\n reason: error.value,\n promise: error\n },\n bubbles: false,\n cancelable: true\n })\n\n return !self.dispatchEvent(ev)\n }\n }(noop, self, CustomEvent))\n }\n\n // istanbul ignore next */\n return noop\n}\n\n// istanbul ignore next */\nfunction noop () {}\n","// maybeThenable :: * -> boolean\nexport default function maybeThenable (x) {\n return (typeof x === 'object' || typeof x === 'function') && x !== null\n}\n","import { pushContext } from './trace'\n\nexport default class Action {\n constructor (promise) {\n this.promise = promise\n this.context = pushContext(this.constructor)\n }\n\n // default onFulfilled action\n /* istanbul ignore next */\n fulfilled (p) {\n this.promise._become(p)\n }\n\n // default onRejected action\n rejected (p) {\n this.promise._become(p)\n return false\n }\n}\n","export default function tryCall (f, x, handle, promise) {\n let result\n // test if `f` (and only it) throws\n try {\n result = f(x)\n } catch (e) {\n promise._reject(e)\n return\n } // else\n handle(promise, result)\n}\n","import Action from './Action'\nimport tryCall from './tryCall'\n\nexport default function then (f, r, p, promise) {\n p._when(new Then(f, r, promise))\n return promise\n}\n\nclass Then extends Action {\n constructor (f, r, promise) {\n super(promise)\n this.f = f\n this.r = r\n }\n\n fulfilled (p) {\n this.runThen(this.f, p)\n }\n\n rejected (p) {\n return this.runThen(this.r, p)\n }\n\n runThen (f, p) {\n if (typeof f !== 'function') {\n this.promise._become(p)\n return false\n }\n tryCall(f, p.value, handleThen, this.promise)\n return true\n }\n}\n\nfunction handleThen (promise, result) {\n promise._resolve(result)\n}\n","import Action from './Action'\nimport maybeThenable from './maybeThenable'\nimport { isRejected } from './inspect'\n\nexport default function (resolve, f, p, promise) {\n p._when(new Finally(resolve, f, promise))\n return promise\n}\n\nexport class Finally extends Action {\n constructor (resolve, f, promise) {\n super(promise)\n this.resolve = resolve\n this.f = f\n }\n\n fulfilled (p) {\n this.runFinally(this.f, p)\n }\n\n rejected (p) {\n return this.runFinally(this.f, p)\n }\n\n runFinally (f, p) {\n let result\n // test iff `f` throws\n try {\n result = f()\n } catch (e) {\n this.promise._reject(e)\n return true\n }\n return this.handleFinally(p, result)\n }\n\n handleFinally (p, finallyResult) {\n if (maybeThenable(finallyResult)) {\n this.resolve(finallyResult)._when(new DeferredFinally(p, this.promise))\n return true\n }\n\n this.promise._become(p)\n return false\n }\n}\n\nclass DeferredFinally extends Action {\n constructor (result, promise) {\n super(promise)\n this.result = result\n }\n\n fulfilled (p) {\n if (isRejected(this.result)) {\n this.promise._reject(this.result.value)\n return\n }\n this.promise._become(this.result)\n }\n}\n","import Action from './Action'\nimport tryCall from './tryCall'\n\nexport default function (f, p, promise) {\n p._when(new Map(f, promise))\n return promise\n}\n\nexport class Map extends Action {\n constructor (f, promise) {\n super(promise)\n this.f = f\n }\n\n fulfilled (p) {\n tryCall(this.f, p.value, handleMap, this.promise)\n }\n}\n\nfunction handleMap (promise, result) {\n promise._fulfill(result)\n}\n","import { Map } from './map'\nimport tryCall from './tryCall'\n\nexport default function (r, f, p, promise) {\n p._when(new Bimap(r, f, promise))\n return promise\n}\n\nclass Bimap extends Map {\n constructor (r, f, promise) {\n super(f, promise)\n this.r = r\n }\n\n rejected (p) {\n tryCall(this.r, p.value, handleMapRejected, this.promise)\n }\n}\n\nfunction handleMapRejected (promise, result) {\n promise._reject(result)\n}\n","import Action from './Action'\nimport tryCall from './tryCall'\nimport maybeThenable from './maybeThenable'\n\nexport default function (f, p, promise) {\n p._when(new Chain(f, promise))\n return promise\n}\n\nclass Chain extends Action {\n constructor (f, promise) {\n super(promise)\n this.f = f\n }\n\n fulfilled (p) {\n tryCall(this.f, p.value, handleChain, this.promise)\n }\n}\n\nfunction handleChain (promise, result) {\n if (!(maybeThenable(result) && typeof result.then === 'function')) {\n promise._reject(new TypeError('f must return a promise'))\n }\n\n promise._resolve(result)\n}\n","import { silenceError } from './inspect'\n\nexport default class Race {\n valueAt (x, i, promise) {\n promise._fulfill(x)\n }\n\n fulfillAt (p, i, promise) {\n promise._become(p)\n }\n\n rejectAt (p, i, promise) {\n // In the case where the result promise has been resolved\n // need to silence all subsequently seen rejections\n promise._isResolved() ? silenceError(p) : promise._become(p)\n }\n\n complete (total, promise) {\n if (total === 0) {\n promise._become(promise.constructor.empty())\n }\n }\n}\n","import { silenceError } from './inspect'\n\nexport default class Merge {\n constructor (mergeHandler, results) {\n this.pending = 0\n this.results = results\n this.mergeHandler = mergeHandler\n }\n\n valueAt (x, i, promise) {\n this.results[i] = x\n this.check(this.pending - 1, promise)\n }\n\n fulfillAt (p, i, promise) {\n this.valueAt(p.value, i, promise)\n }\n\n rejectAt (p, i, promise) {\n // In the case where the result promise has been resolved\n // need to silence all subsequently seen rejections\n promise._isResolved() ? silenceError(p) : promise._become(p)\n }\n\n complete (total, promise) {\n this.check(this.pending + total, promise)\n }\n\n check (pending, promise) {\n this.pending = pending\n if (pending === 0) {\n this.mergeHandler.merge(promise, this.results)\n }\n }\n}\n","import { isFulfilled, isRejected, silenceError } from './inspect'\nimport Action from './Action'\nimport maybeThenable from './maybeThenable'\n\nexport function resultsArray (iterable) {\n return Array.isArray(iterable) ? new Array(iterable.length) : []\n}\n\nexport function resolveIterable (resolve, handler, promises, promise) {\n const run = Array.isArray(promises) ? runArray : runIterable\n try {\n run(resolve, handler, promises, promise)\n } catch (e) {\n promise._reject(e)\n }\n return promise.near()\n}\n\nfunction runArray (resolve, handler, promises, promise) {\n let i = 0\n\n for (; i < promises.length; ++i) {\n handleItem(resolve, handler, promises[i], i, promise)\n }\n\n handler.complete(i, promise)\n}\n\nfunction runIterable (resolve, handler, promises, promise) {\n let i = 0\n const iter = promises[Symbol.iterator]()\n\n while (true) {\n const step = iter.next()\n if (step.done) {\n break\n }\n handleItem(resolve, handler, step.value, i++, promise)\n }\n\n handler.complete(i, promise)\n}\n\nfunction handleItem (resolve, handler, x, i, promise) {\n /* eslint complexity:[1,6] */\n if (!maybeThenable(x)) {\n handler.valueAt(x, i, promise)\n return\n }\n\n const p = resolve(x)\n\n if (promise._isResolved()) {\n if (!isFulfilled(p)) {\n silenceError(p)\n }\n } else if (isFulfilled(p)) {\n handler.fulfillAt(p, i, promise)\n } else if (isRejected(p)) {\n handler.rejectAt(p, i, promise)\n } else {\n p._runAction(new AtIndex(handler, i, promise))\n }\n}\n\nclass AtIndex extends Action {\n constructor (handler, i, promise) {\n super(promise)\n this.i = i\n this.handler = handler\n }\n\n fulfilled (p) {\n this.handler.fulfillAt(p, this.i, this.promise)\n }\n\n rejected (p) {\n return this.handler.rejectAt(p, this.i, this.promise)\n }\n}\n","(function() {\n\n 'use strict';\n\n /* eslint comma-dangle: [\"off\"], no-var: [\"off\"], strict: [\"error\", \"function\"] */\n /* global self */\n\n var mapping = {\n equals: 'fantasy-land/equals',\n lte: 'fantasy-land/lte',\n compose: 'fantasy-land/compose',\n id: 'fantasy-land/id',\n concat: 'fantasy-land/concat',\n empty: 'fantasy-land/empty',\n invert: 'fantasy-land/invert',\n filter: 'fantasy-land/filter',\n map: 'fantasy-land/map',\n contramap: 'fantasy-land/contramap',\n ap: 'fantasy-land/ap',\n of: 'fantasy-land/of',\n alt: 'fantasy-land/alt',\n zero: 'fantasy-land/zero',\n reduce: 'fantasy-land/reduce',\n traverse: 'fantasy-land/traverse',\n chain: 'fantasy-land/chain',\n chainRec: 'fantasy-land/chainRec',\n extend: 'fantasy-land/extend',\n extract: 'fantasy-land/extract',\n bimap: 'fantasy-land/bimap',\n promap: 'fantasy-land/promap'\n };\n\n if (typeof module === 'object' && typeof module.exports === 'object') {\n module.exports = mapping;\n } else {\n self.FantasyLand = mapping;\n }\n\n}());\n","import TaskQueue from './TaskQueue'\nimport ErrorHandler from './ErrorHandler'\nimport makeEmitError from './emitError'\nimport maybeThenable from './maybeThenable'\nimport { PENDING, FULFILLED, REJECTED, NEVER } from './state'\nimport { isNever, isSettled } from './inspect'\n\nimport then from './then'\nimport _finally from './finally'\nimport map from './map'\nimport bimap from './bimap'\nimport chain from './chain'\n\nimport Race from './Race'\nimport Merge from './Merge'\nimport { resolveIterable, resultsArray } from './iterable'\n\nimport { swapContext, peekContext } from './trace'\n\nimport fl from 'fantasy-land'\n\nconst taskQueue = new TaskQueue()\nexport { taskQueue }\n\n/* istanbul ignore next */\nconst handleError = ({ value }) => { throw value }\n\n/* istanbul ignore next */\nconst errorHandler = new ErrorHandler(makeEmitError(), handleError)\n\n// -------------------------------------------------------------\n// ## Types\n// -------------------------------------------------------------\n\n// Internal base type, provides fantasy-land namespace\n// and type representative\nclass Core {\n constructor () {\n this.context = peekContext()\n }\n // empty :: Promise e a\n static empty () {\n return never()\n }\n\n // of :: a -> Promise e a\n static of (x) {\n return fulfill(x)\n }\n\n static [fl.empty] () {\n return never()\n }\n\n static [fl.of] (x) {\n return fulfill(x)\n }\n\n finally (f) {\n return typeof f === 'function'\n ? _finally(resolve, f, this.near(), new Future())\n : this\n }\n\n [fl.map] (f) {\n return this.map(f)\n }\n\n [fl.bimap] (r, f) {\n return this.bimap(r, f)\n }\n\n [fl.ap] (pf) {\n return pf.ap(this)\n }\n\n [fl.chain] (f) {\n return this.chain(f)\n }\n\n [fl.concat] (p) {\n return this.concat(p)\n }\n\n [fl.alt] (p) {\n return this.or(p)\n }\n\n static [fl.zero] () {\n return never()\n }\n\n // @deprecated The name concat is deprecated, use or() instead.\n concat (b) {\n return this.or(b)\n }\n}\n\n// data Promise e a where\n// Future :: Promise e a\n// Fulfilled :: a -> Promise e a\n// Rejected :: Error e => e -> Promise e a\n// Never :: Promise e a\n\n// Future :: Promise e a\n// A promise whose value cannot be known until some future time\nexport class Future extends Core {\n constructor () {\n super()\n this.ref = void 0\n this.action = void 0\n this.length = 0\n }\n\n // then :: Promise e a -> (a -> b) -> Promise e b\n // then :: Promise e a -> () -> (e -> b) -> Promise e b\n // then :: Promise e a -> (a -> b) -> (e -> b) -> Promise e b\n then (f, r) {\n const n = this.near()\n return n === this ? then(f, r, this, new Future()) : n.then(f, r)\n }\n\n // catch :: Promise e a -> (e -> b) -> Promise e b\n catch (r) {\n const n = this.near()\n return n === this ? then(void 0, r, this, new Future()) : n.catch(r)\n }\n\n // map :: Promise e a -> (a -> b) -> Promise e b\n map (f) {\n const n = this.near()\n return n === this ? map(f, this, new Future()) : n.map(f)\n }\n\n bimap (r, f) {\n const n = this.near()\n return n === this\n ? bimap(r, f, this, new Future())\n : n.bimap(r, f)\n }\n\n // ap :: Promise e (a -> b) -> Promise e a -> Promise e b\n ap (p) {\n const n = this.near()\n const pn = p.near()\n return n === this ? this.chain(f => pn.map(f)) : n.ap(pn)\n }\n\n // chain :: Promise e a -> (a -> Promise e b) -> Promise e b\n chain (f) {\n const n = this.near()\n return n === this ? chain(f, this, new Future()) : n.chain(f)\n }\n\n // or :: Promise e a -> Promise e a -> Promise e a\n or (b) {\n /* eslint complexity:[2,5] */\n const n = this.near()\n const bn = b.near()\n\n return isSettled(n) || isNever(bn) ? n\n : isSettled(bn) || isNever(n) ? bn\n : race([n, bn])\n }\n\n // toString :: Promise e a -> String\n toString () {\n return '[object ' + this.inspect() + ']'\n }\n\n // inspect :: Promise e a -> String\n inspect () {\n const n = this.near()\n return n === this ? 'Promise { pending }' : n.inspect()\n }\n\n // near :: Promise e a -> Promise e a\n near () {\n if (!this._isResolved()) {\n return this\n }\n\n this.ref = this.ref.near()\n return this.ref\n }\n\n // state :: Promise e a -> Int\n state () {\n return this._isResolved() ? this.ref.near().state() : PENDING\n }\n\n _isResolved () {\n return this.ref !== void 0\n }\n\n _when (action) {\n this._runAction(action)\n }\n\n _runAction (action) {\n if (this.action === void 0) {\n this.action = action\n } else {\n this[this.length++] = action\n }\n }\n\n _resolve (x) {\n this._become(resolve(x))\n }\n\n _fulfill (x) {\n this._become(new Fulfilled(x))\n }\n\n _reject (e) {\n if (this._isResolved()) {\n return\n }\n\n this.__become(new Rejected(e))\n }\n\n _become (p) {\n if (this._isResolved()) {\n return\n }\n\n this.__become(p)\n }\n\n __become (p) {\n this.ref = p === this ? cycle() : p\n\n if (this.action === void 0) {\n return\n }\n\n taskQueue.add(this)\n }\n\n run () {\n const p = this.ref.near()\n p._runAction(this.action)\n this.action = void 0\n\n for (let i = 0; i < this.length; ++i) {\n p._runAction(this[i])\n this[i] = void 0\n }\n }\n}\n\n// Fulfilled :: a -> Promise e a\n// A promise whose value is already known\nclass Fulfilled extends Core {\n constructor (x) {\n super()\n this.value = x\n }\n\n then (f) {\n return typeof f === 'function' ? then(f, void 0, this, new Future()) : this\n }\n\n catch () {\n return this\n }\n\n map (f) {\n return map(f, this, new Future())\n }\n\n bimap (_, f) {\n return this.map(f)\n }\n\n ap (p) {\n return p.map(this.value)\n }\n\n chain (f) {\n return chain(f, this, new Future())\n }\n\n or () {\n return this\n }\n\n toString () {\n return '[object ' + this.inspect() + ']'\n }\n\n inspect () {\n return 'Promise { fulfilled: ' + this.value + ' }'\n }\n\n state () {\n return FULFILLED\n }\n\n near () {\n return this\n }\n\n _when (action) {\n taskQueue.add(new Continuation(action, this))\n }\n\n _runAction (action) {\n const c = swapContext(action.context)\n action.fulfilled(this)\n swapContext(c)\n }\n}\n\n// Rejected :: Error e => e -> Promise e a\n// A promise whose value cannot be known due to some reason/error\nclass Rejected extends Core {\n constructor (e) {\n super()\n this.value = e\n this._state = REJECTED\n errorHandler.track(this)\n }\n\n then (_, r) {\n return typeof r === 'function' ? this.catch(r) : this\n }\n\n catch (r) {\n return then(void 0, r, this, new Future())\n }\n\n map () {\n return this\n }\n\n bimap (r) {\n return bimap(r, void 0, this, new Future())\n }\n\n ap () {\n return this\n }\n\n chain () {\n return this\n }\n\n or () {\n return this\n }\n\n toString () {\n return '[object ' + this.inspect() + ']'\n }\n\n inspect () {\n return 'Promise { rejected: ' + this.value + ' }'\n }\n\n state () {\n return this._state\n }\n\n near () {\n return this\n }\n\n _when (action) {\n taskQueue.add(new Continuation(action, this))\n }\n\n _runAction (action) {\n const c = swapContext(action.context)\n if (action.rejected(this)) {\n errorHandler.untrack(this)\n }\n swapContext(c)\n }\n}\n\n// Never :: Promise e a\n// A promise that waits forever for its value to be known\nclass Never extends Core {\n then () {\n return this\n }\n\n catch () {\n return this\n }\n\n finally () {\n return this\n }\n\n map () {\n return this\n }\n\n bimap () {\n return this\n }\n\n ap () {\n return this\n }\n\n chain () {\n return this\n }\n\n or (b) {\n return b\n }\n\n toString () {\n return '[object ' + this.inspect() + ']'\n }\n\n inspect () {\n return 'Promise { never }'\n }\n\n state () {\n return PENDING | NEVER\n }\n\n near () {\n return this\n }\n\n _when () {\n }\n\n _runAction () {\n }\n}\n\n// -------------------------------------------------------------\n// ## Creating promises\n// -------------------------------------------------------------\n\n// resolve :: Thenable e a -> Promise e a\n// resolve :: a -> Promise e a\nexport function resolve (x) {\n return isPromise(x) ? x.near()\n : maybeThenable(x) ? refForMaybeThenable(fulfill, x)\n : new Fulfilled(x)\n}\n\n// reject :: e -> Promise e a\nexport function reject (e) {\n return new Rejected(e)\n}\n\n// never :: Promise e a\nexport function never () {\n return new Never()\n}\n\n// fulfill :: a -> Promise e a\nexport function fulfill (x) {\n return new Fulfilled(x)\n}\n\n// future :: () -> { resolve: Resolve e a, promise: Promise e a }\n// type Resolve e a = a|Thenable e a -> ()\nexport function future () {\n const promise = new Future()\n return {resolve: x => promise._resolve(x), promise}\n}\n\n// -------------------------------------------------------------\n// ## Iterables\n// -------------------------------------------------------------\n\n// all :: Iterable (Promise e a) -> Promise e [a]\nexport function all (promises) {\n const handler = new Merge(allHandler, resultsArray(promises))\n return iterablePromise(handler, promises)\n}\n\nconst allHandler = {\n merge (promise, args) {\n promise._fulfill(args)\n }\n}\n\n// race :: Iterable (Promise e a) -> Promise e a\nexport function race (promises) {\n return iterablePromise(new Race(), promises)\n}\n\nfunction isIterable (x) {\n return typeof x === 'object' && x !== null\n}\n\nexport function iterablePromise (handler, iterable) {\n if (!isIterable(iterable)) {\n return reject(new TypeError('expected an iterable'))\n }\n\n const p = new Future()\n return resolveIterable(resolveMaybeThenable, handler, iterable, p)\n}\n\n// -------------------------------------------------------------\n// # Internals\n// -------------------------------------------------------------\n\n// isPromise :: * -> boolean\nfunction isPromise (x) {\n return x instanceof Core\n}\n\nfunction resolveMaybeThenable (x) {\n return isPromise(x) ? x.near() : refForMaybeThenable(fulfill, x)\n}\n\nfunction refForMaybeThenable (otherwise, x) {\n try {\n const then = x.then\n return typeof then === 'function'\n ? extractThenable(then, x)\n : otherwise(x)\n } catch (e) {\n return new Rejected(e)\n }\n}\n\n// WARNING: Naming the first arg \"then\" triggers babel compilation bug\nfunction extractThenable (thn, thenable) {\n const p = new Future()\n\n try {\n thn.call(thenable, x => p._resolve(x), e => p._reject(e))\n } catch (e) {\n p._reject(e)\n }\n\n return p.near()\n}\n\nfunction cycle () {\n return new Rejected(new TypeError('resolution cycle'))\n}\n\nclass Continuation {\n constructor (action, promise) {\n this.action = action\n this.promise = promise\n }\n\n run () {\n this.promise._runAction(this.action)\n }\n}\n","import Action from './Action'\n\nexport default function (ms, p, promise) {\n p._runAction(new Delay(ms, promise))\n return promise\n}\n\nclass Delay extends Action {\n constructor (time, promise) {\n super(promise)\n this.time = time\n }\n\n fulfilled (p) {\n /* global setTimeout */\n setTimeout(become, this.time, p, this.promise)\n }\n}\n\nfunction become (p, promise) {\n promise._become(p)\n}\n","export default class TimeoutError extends Error {\n constructor (message) {\n super()\n this.message = message\n this.name = TimeoutError.name\n /* istanbul ignore else */\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, TimeoutError)\n }\n }\n}\n","import Action from './Action'\nimport TimeoutError from './TimeoutError'\n\nexport default function (ms, p, promise) {\n const timer = setTimeout(rejectOnTimeout, ms, promise)\n p._runAction(new Timeout(timer, promise))\n return promise\n}\n\nclass Timeout extends Action {\n constructor (timer, promise) {\n super(promise)\n this.timer = timer\n }\n\n fulfilled (p) {\n clearTimeout(this.timer)\n this.promise._become(p)\n }\n\n rejected (p) {\n clearTimeout(this.timer)\n return super.rejected(p)\n }\n}\n\nfunction rejectOnTimeout (promise) {\n promise._reject(new TimeoutError('promise timeout'))\n}\n","import { silenceError } from './inspect.js'\n\nexport default class Any {\n constructor () {\n this.pending = 0\n }\n\n valueAt (x, i, promise) {\n promise._fulfill(x)\n }\n\n fulfillAt (p, i, promise) {\n promise._become(p)\n }\n\n rejectAt (p, i, promise) {\n silenceError(p)\n this.check(this.pending - 1, promise)\n }\n\n complete (total, promise) {\n this.check(this.pending + total, promise)\n }\n\n check (pending, promise) {\n this.pending = pending\n if (pending === 0) {\n promise._reject(new RangeError('No fulfilled promises in input'))\n }\n }\n}\n","import { silenceError } from './inspect'\n\nexport default class Settle {\n constructor (resolve, results) {\n this.pending = 0\n this.results = results\n this.resolve = resolve\n }\n\n valueAt (x, i, promise) {\n this.settleAt(this.resolve(x), i, promise)\n }\n\n fulfillAt (p, i, promise) {\n this.settleAt(p, i, promise)\n }\n\n rejectAt (p, i, promise) {\n silenceError(p)\n this.settleAt(p, i, promise)\n }\n\n settleAt (p, i, promise) {\n this.results[i] = p\n this.check(this.pending - 1, promise)\n }\n\n complete (total, promise) {\n this.check(this.pending + total, promise)\n }\n\n check (pending, promise) {\n this.pending = pending\n if (pending === 0) {\n promise._fulfill(this.results)\n }\n }\n}\n","import { swapContext } from './trace'\n\nexport default function runPromise (f, thisArg, args, promise) {\n /* eslint complexity:[2,5] */\n function resolve (x) {\n const c = swapContext(promise.context)\n promise._resolve(x)\n swapContext(c)\n }\n\n function reject (e) {\n const c = swapContext(promise.context)\n promise._reject(e)\n swapContext(c)\n }\n\n switch (args.length) {\n case 0:\n f.call(thisArg, resolve, reject)\n break\n case 1:\n f.call(thisArg, args[0], resolve, reject)\n break\n case 2:\n f.call(thisArg, args[0], args[1], resolve, reject)\n break\n case 3:\n f.call(thisArg, args[0], args[1], args[2], resolve, reject)\n break\n default:\n args.push(resolve, reject)\n f.apply(thisArg, args)\n }\n\n return promise\n}\n","import { swapContext } from './trace'\n\nexport default function runNode (f, thisArg, args, promise) {\n /* eslint complexity:[2,5] */\n function settleNode (e, x) {\n const c = swapContext(promise.context)\n if (e) {\n promise._reject(e)\n } else {\n promise._fulfill(x)\n }\n swapContext(c)\n }\n\n switch (args.length) {\n case 0:\n f.call(thisArg, settleNode)\n break\n case 1:\n f.call(thisArg, args[0], settleNode)\n break\n case 2:\n f.call(thisArg, args[0], args[1], settleNode)\n break\n case 3:\n f.call(thisArg, args[0], args[1], args[2], settleNode)\n break\n default:\n args.push(settleNode)\n f.apply(thisArg, args)\n }\n\n return promise\n}\n","import Action from './Action'\nimport { swapContext } from './trace'\n\nexport default function (resolve, iterator, promise) {\n new Coroutine(resolve, iterator, promise).run()\n return promise\n}\n\nclass Coroutine extends Action {\n constructor (resolve, iterator, promise) {\n super(promise)\n this.resolve = resolve\n this.generator = iterator\n }\n\n run () {\n this.tryStep(this.generator.next, void 0)\n }\n\n tryStep (resume, x) {\n const context = swapContext(this.context)\n let result\n // test if `resume` (and only it) throws\n try {\n result = resume.call(this.generator, x)\n } catch (e) {\n this.handleReject(e)\n return\n } finally {\n swapContext(context)\n }// else\n\n this.handleResult(result)\n }\n\n handleResult (result) {\n if (result.done) {\n return this.promise._resolve(result.value)\n }\n\n this.resolve(result.value)._when(this)\n }\n\n handleReject (e) {\n this.promise._reject(e)\n }\n\n fulfilled (p) {\n this.tryStep(this.generator.next, p.value)\n }\n\n rejected (p) {\n this.tryStep(this.generator.throw, p.value)\n return true\n }\n}\n","import { isFulfilled, isRejected, isSettled, isPending, isNever, isHandled, getValue, getReason } from './inspect'\nimport { Future, resolve, reject, future, never, fulfill, all, race, iterablePromise, taskQueue } from './Promise'\n\nimport _delay from './delay'\nimport _timeout from './timeout'\n\nimport Any from './Any'\nimport Merge from './Merge'\nimport Settle from './Settle'\nimport { resultsArray } from './iterable'\n\nimport _runPromise from './runPromise'\nimport _runNode from './node'\nimport _runCoroutine from './coroutine.js'\n\nimport { isDebug } from './env'\nimport { swapContext, pushContext, enableAsyncTraces, disableAsyncTraces } from './trace'\n\nexport { enableAsyncTraces, disableAsyncTraces }\n\n/* istanbul ignore next */\nif (isDebug) {\n enableAsyncTraces()\n}\n\n// -------------------------------------------------------------\n// ## Core promise methods\n// -------------------------------------------------------------\n\nexport {\n resolve, reject, future, never, fulfill, all, race,\n isFulfilled, isRejected, isSettled, isPending, isNever, isHandled,\n getValue, getReason\n}\n\n// -------------------------------------------------------------\n// ## Coroutine\n// -------------------------------------------------------------\n\n// coroutine :: Generator e a -> (...* -> Promise e a)\n// Make a coroutine from a promise-yielding generator\nexport function coroutine (generator) {\n return function coroutinified (...args) {\n return runGenerator(generator, this, args)\n }\n}\n\nfunction runGenerator (generator, thisArg, args) {\n const iterator = generator.apply(thisArg, args)\n return _runCoroutine(resolve, iterator, new Future())\n}\n\n// -------------------------------------------------------------\n// ## Node-style async\n// -------------------------------------------------------------\n\n// type Nodeback e a = e -> a -> ()\n// type NodeApi e a = ...* -> Nodeback e a -> ()\n\n// fromNode :: NodeApi e a -> (...args -> Promise e a)\n// Turn a Node API into a promise API\nexport function fromNode (f) {\n return function promisified (...args) {\n return runResolver(_runNode, f, this, args, new Future())\n }\n}\n\n// runNode :: NodeApi e a -> ...* -> Promise e a\n// Run a Node API, returning a promise for the outcome\nexport function runNode (f, ...args) {\n return runResolver(_runNode, f, this, args, new Future())\n}\n\n// -------------------------------------------------------------\n// ## Make a promise\n// -------------------------------------------------------------\n\n// type Resolve e a = a|Thenable e a -> ()\n// type Reject e = e -> ()\n// type Producer e a = (...* -> Resolve e a -> Reject e -> ())\n// runPromise :: Producer e a -> ...* -> Promise e a\nexport function runPromise (f, ...args) {\n return runResolver(_runPromise, f, this, args, new Future())\n}\n\nfunction runResolver (run, f, thisArg, args, p) {\n checkFunction(f)\n\n try {\n run(f, thisArg, args, p)\n } catch (e) {\n p._reject(e)\n }\n\n return p\n}\n\n// -------------------------------------------------------------\n// ## Time\n// -------------------------------------------------------------\n\n// delay :: number -> Promise e a -> Promise e a\nexport function delay (ms, x) {\n /* eslint complexity:[2,4] */\n const p = resolve(x)\n return ms <= 0 || isRejected(p) || isNever(p) ? p\n : _delay(ms, p, new Future())\n}\n\n// timeout :: number -> Promise e a -> Promise (e|TimeoutError) a\nexport function timeout (ms, x) {\n const p = resolve(x)\n return isSettled(p) ? p : _timeout(ms, p, new Future())\n}\n\n// -------------------------------------------------------------\n// ## Iterables\n// -------------------------------------------------------------\n\n// any :: Iterable (Promise e a) -> Promise e a\nexport function any (promises) {\n return iterablePromise(new Any(), promises)\n}\n\n// settle :: Iterable (Promise e a) -> Promise e [Promise e a]\nexport function settle (promises) {\n const handler = new Settle(resolve, resultsArray(promises))\n return iterablePromise(handler, promises)\n}\n\n// -------------------------------------------------------------\n// ## Lifting\n// -------------------------------------------------------------\n\n// merge :: (...* -> b) -> ...Promise e a -> Promise e b\nexport function merge (f, ...args) {\n return runMerge(f, this, args)\n}\n\nfunction runMerge (f, thisArg, args) {\n const handler = new Merge(new MergeHandler(f, thisArg), resultsArray(args))\n return iterablePromise(handler, args)\n}\n\nclass MergeHandler {\n constructor (f, c) {\n this.context = pushContext(this.constructor, Merge.name)\n this.f = f\n this.c = c\n this.promise = void 0\n this.args = void 0\n }\n\n merge (promise, args) {\n this.promise = promise\n this.args = args\n taskQueue.add(this)\n }\n\n run () {\n const c = swapContext(this.context)\n try {\n this.promise._resolve(this.f.apply(this.c, this.args))\n } catch (e) {\n this.promise._reject(e)\n }\n swapContext(c)\n }\n}\n\nfunction checkFunction (f) {\n if (typeof f !== 'function') {\n throw new TypeError('must provide a resolver function')\n }\n}\n\n// -------------------------------------------------------------\n// ## ES6 Promise polyfill\n// -------------------------------------------------------------\n\nconst NOARGS = []\n\n// type Resolve a = a -> ()\n// type Reject e = e -> ()\n// Promise :: (Resolve a -> Reject e) -> Promise e a\nclass CreedPromise extends Future {\n constructor (f) {\n super()\n runResolver(_runPromise, f, void 0, NOARGS, this)\n }\n}\n\nCreedPromise.resolve = resolve\nCreedPromise.reject = reject\nCreedPromise.all = all\nCreedPromise.race = race\n\nexport function shim () {\n /* global self */\n const orig = typeof Promise === 'function' && Promise\n\n /* istanbul ignore if */\n if (typeof self !== 'undefined') {\n self.Promise = CreedPromise\n /* istanbul ignore else */\n } else if (typeof global !== 'undefined') {\n global.Promise = CreedPromise\n }\n\n return orig\n}\n\nexport { CreedPromise as Promise }\n\n/* istanbul ignore if */\nif (typeof Promise !== 'function') {\n shim()\n}\n"],"names":["const","let","this","UNHANDLED_REJECTION","noop","super","fl","then","_runNode","runNode","runPromise","_runPromise"],"mappings":";;;;;;AAAA;AACA,AAAOA,IAAM,OAAO,KAAK,CAAC,IAAI,EAAC;AAC/B,AAAOA,IAAM,SAAS,GAAG,CAAC,IAAI,EAAC;AAC/B,AAAOA,IAAM,QAAQ,IAAI,CAAC,IAAI,EAAC;AAC/B,AAAOA,IAAM,OAAO,KAAK,SAAS,GAAG,SAAQ;AAC7C,AAAOA,IAAM,KAAK,OAAO,CAAC,IAAI,EAAC;;AAE/B,AAAOA,IAA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C,EAAC;GACvD,CAAC,OAAO,CAAC,EAAE;IACZ,IAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EAAC;GACxB;EACH,WAAa,CAAC,CAAC,EAAC;CACf,CACF;;AAED,SAAS,aAAa,EAAE,CAAC,EAAE;EACzB,IAAI,OAAO,CAAC,KAAK,UAAU,EAAE;IAC3B,MAAM,IAAI,SAAS,CAAC,kCAAkC,CAAC;GACxD;CACF;;;;;;AAMDA,IAAM,MAAM,GAAG,GAAE;;;;;AAKjB,IAAM,YAAY;EAChB,qBAAW,EAAE,CAAC,EAAE;IACdK,cAAK,KAAC,EAAC;IACP,WAAW,CAACM,UAAW,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI,EAAC;;;;;;;;EAH1B,SAK1B;;AAED,YAAY,CAAC,OAAO,GAAG,QAAO;AAC9B,YAAY,CAAC,MAAM,GAAG,OAAM;AAC5B,YAAY,CAAC,GAAG,GAAG,IAAG;AACtB,YAAY,CAAC,IAAI,GAAG,KAAI;;AAExB,AAAO,SAAS,IAAI,IAAI;;EAEtBX,IAAM,IAAI,GAAG,OAAO,OAAO,KAAK,UAAU,IAAI,QAAO;;;EAGrD,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;IAC/B,IAAI,CAAC,OAAO,GAAG,aAAY;;GAE5B,MAAM,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACxC,MAAM,CAAC,OAAO,GAAG,aAAY;GAC9B;;EAED,OAAO,IAAI;CACZ;;AAED;AAGA,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;EACjC,IAAI,GAAE;CACP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/creed.min.js b/dist/creed.min.js index 9417560..1351fb1 100644 --- a/dist/creed.min.js +++ b/dist/creed.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.creed={})}(this,function(t){"use strict";function e(t){return(t.state()&Q)>0}function n(t){return(t.state()&X)>0}function r(t){return(t.state()&Y)>0}function o(t){return(t.state()&Z)>0}function i(t){return(t.state()&tt)>0}function c(t){t._runAction(et)}function u(t){return function(){return setTimeout(t,0)}}function s(t){return function(){return process.nextTick(t)}}function p(t){var e=document.createTextNode("");new rt(t).observe(e,{characterData:!0});var n=0;return function(){e.data=n^=1}}function a(t,e){return t instanceof Error&&!("_creed$OriginalStack"in t)&&(t._creed$OriginalStack=t.stack,t.stack=f(gt(t.stack),e)),t}function f(t,e){if(null==e)return t;var n=gt(e.stack);return f(n.indexOf(" at ")<0?t:t+"\n"+n,e.next)}function h(t,e){try{l(e,t)}finally{e.length=0}}function l(t,e){for(var n=0;n0},t.isNever=o,t.isHandled=i,t.getValue=function(t){var n=t.near();if(!e(n))throw new TypeError("getValue called on "+t);return n.value},t.getReason=function(t){var e=t.near();if(!n(e))throw new TypeError("getReason called on "+t);return c(e),e.value},t.coroutine=function(t){return function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return F(t,this,e)}},t.fromNode=function(t){return function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return G(B,t,this,e,new Ct)}},t.runNode=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];return G(B,t,this,e,new Ct)},t.runPromise=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];return G($,t,this,e,new Ct)},t.delay=function(t,e){var r=E(e);return t<=0||n(r)||o(r)?r:Ft(t,r,new Ct)},t.timeout=function(t,e){var n=E(e);return r(n)?n:It(t,n,new Ct)},t.any=function(t){return M(new Lt,t)},t.settle=function(t){return M(new Qt(E,j(t)),t)},t.merge=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];return U(t,this,e)},t.shim=J,t.Promise=ee,Object.defineProperty(t,"__esModule",{value:!0})}); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.creed={})}(this,function(t){"use strict";var e=1,n=2,r=4,o=n|r,i=8,c=16;function u(t){return(t.state()&n)>0}function s(t){return(t.state()&r)>0}function p(t){return(t.state()&o)>0}function a(t){return(t.state()&i)>0}function f(t){return(t.state()&c)>0}function h(t){t._runAction(l)}var l={fulfilled:function(){},rejected:function(t){t._state|=c}},y="undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process),d="function"==typeof MutationObserver&&MutationObserver||"function"==typeof WebKitMutationObserver&&WebKitMutationObserver,v=function(t){return y&&process.env[t]},_=v("CREED_DEBUG")||"development"===v("NODE_ENV")||"test"===v("NODE_ENV");function m(t){return y?(n=t,function(){return process.nextTick(n)}):d?function(t){var e=document.createTextNode("");new d(t).observe(e,{characterData:!0});var n=0;return function(){e.data=n^=1}}(t):(e=t,function(){return setTimeout(e,0)});var e,n}var w=function(){var t=this;this.tasks=new Array(65536),this.length=0,this.drain=m(function(){return t._drain()})};w.prototype.add=function(t){0===this.length&&this.drain(),this.tasks[this.length++]=t},w.prototype._drain=function(){for(var t=this.tasks,e=0;e0},t.isNever=a,t.isHandled=f,t.getValue=function(t){var e=t.near();if(!u(e))throw new TypeError("getValue called on "+t);return e.value},t.getReason=function(t){var e=t.near();if(!s(e))throw new TypeError("getReason called on "+t);return h(e),e.value},t.coroutine=function(t){return function(){for(var e,n,r,o,i,c=[],u=arguments.length;u--;)c[u]=arguments[u];return e=this,n=c,r=vt,o=t.apply(e,n),i=new ht,new Vt(r,o,i).run(),i}},t.fromNode=function(t){return function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return zt(Ht,t,this,e,new ht)}},t.runNode=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];return zt(Ht,t,this,e,new ht)},t.runPromise=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];return zt(Mt,t,this,e,new ht)},t.delay=function(t,e){var n,r,o,i=vt(e);return t<=0||s(i)||a(i)?i:(n=t,r=i,o=new ht,r._runAction(new Tt(n,o)),o)},t.timeout=function(t,e){var n,r,o,i,c=vt(e);return p(c)?c:(n=t,r=c,o=new ht,i=setTimeout(Nt,n,o),r._runAction(new Pt(i,o)),o)},t.any=function(t){return At(new Ft,t)},t.settle=function(t){return At(new Dt(vt,nt(t)),t)},t.merge=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return e=n,At(new et(new Ct(t,this),nt(e)),e)},t.shim=Wt,t.Promise=Kt,Object.defineProperty(t,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/package.json b/package.json index 462371a..20d0e77 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "creed", - "version": "1.3.1", + "version": "1.4.0", "description": "Sophisticated and functionally-minded async with advanced features: coroutines, promises, ES2015 iterables, fantasy-land", "main": "dist/creed.js", "module": "dist/creed.es.js",