{"_id":"fun-promises","_rev":"49-ba23dd0de95cbda031bc2b359d5dce50","name":"fun-promises","dist-tags":{"latest":"2.1.0","next":"2.1.0-rc.2"},"versions":{"1.1.0-alpha.1":{"name":"fun-promises","version":"1.1.0-alpha.1","description":"A library for making Promises more friendly, fluent, and fun(ctional).","main":"dist/node/v14/index.js","module":"dist/es6/esm/index.js","browser":"dist/browser/min/index.js","reactNative":"dist/rn/index.js","source":"index.ts","repository":{"type":"git","url":"git@github.com:RobertFischer/fun-promises.git"},"author":{"name":"Robert Fischer"},"license":"Unlicense","private":false,"keywords":["promise","performance","promises","promises-a","promises-aplus","async","await","deferred","deferreds","future","flow control","dsl","fluent interface","functional programming","functional"],"homepage":"https://robertfischer.github.io/fun-promises/","dependencies":{"@babel/runtime-corejs3":"^7.12.5","core-js":"^3.7.0","debug":"^4.2.0","lodash":"^4.17.20","tslib":"^2.0.3"},"devDependencies":{"@babel/cli":"^7.12.1","@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-runtime":"^7.12.1","@babel/preset-env":"^7.12.7","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/github":"^7.1.1","@semantic-release/npm":"^7.0.6","@semantic-release/release-notes-generator":"^9.0.1","@tsconfig/node10":"^1.0.7","@tsconfig/node12":"^1.0.7","@tsconfig/node14":"^1.0.0","@tsconfig/react-native":"^1.0.2","@types/debug":"^4.1.5","@types/lodash":"^4.14.165","babel-minify":"^0.5.1","babel-plugin-import":"^1.13.3","babel-plugin-minify-dead-code-elimination":"^0.5.1","babel-plugin-minify-simplify":"^0.5.1","babel-plugin-remove-debug":"^0.0.4","conventional-changelog-conventionalcommits":"^4.5.0","cz-conventional-changelog":"^3.3.0","husky":"^4.3.0","jest":"^26.6.3","jest-extended":"^0.11.5","lint-staged":"^10.5.1","parcel":"^1.12.4","prettier":"^2.1.2","semantic-release":"^17.2.2","semantic-release-npm-deprecate-old-versions":"^1.0.1","ts-jest":"^26.4.3","typedoc":"^0.19.2","typedoc-plugin-nojekyll":"^1.0.1","typescript":"^4.1.2"},"scripts":{"test":"jest --detectOpenHandles --forceExit ./*.test.js ./src/*.test.js","build:docs":"rm -rf ./docs && yarn build:docs:typedocs && yarn build:docs:changelog && yarn build:docs:test && yarn build:docs:coverage && mkdir -p ./dist && tar cavf ./dist/docs.tgz ./docs","build:docs:typedocs":"typedoc --tsconfig tsconfig.json","build:docs:changelog":"cp ./CHANGELOG.md ./docs/ || true","build:docs:test":"yarn test --verbose 2>&1 | tee ./docs/test-results.txt","build:docs:coverage":"mkdir -p ./docs && npx browserslist --update-db && (( echo 'Explicitly Supported Browsers (MUST support Promises)' && npx browserslist && npx browserslist --coverage && npx browserslist --coverage=US && echo 'Note that functionally equivalent but unlisted browsers do not count in these stats, so real coverage is much higher than the percentages reported.' ) | tee ./docs/coverage.txt)","watch:compile":"tsc --watch --noEmit -p tsconfig.json","watch:test":"yarn test --watch","build":"DEBUG='*' echo 'Executing build' && rm -rf dist && yarn build:esnext && yarn build:es6 && yarn build:node && yarn build:browser && yarn build:docs","build:esnext":"tsc -p tsconfig.json","build:es6":"yarn build:cjs && yarn build:esm && yarn build:umd && yarn build:amd","build:cjs":"tsc -p ./tsconfig/cjs.json","build:esm":"tsc -p ./tsconfig/esm.json","build:umd":"tsc -p ./tsconfig/umd.json","build:amd":"tsc -p ./tsconfig/amd.json","build:node":"yarn build:node:10 && yarn build:node:12 && yarn build:node:14","build:node:10":"tsc -p ./tsconfig/node10.json","build:node:12":"tsc -p ./tsconfig/node12.json","build:node:14":"tsc -p ./tsconfig/node14.json","build:browser":"yarn build:esnext && parcel build ./dist/esnext/index.js --target browser --out-dir ./dist/browser/ --global FunPromise --detailed-report 15","prepack":"echo 'Executing prepack' && yarn build","serve:docs":"yarn build:docs && http-server ./docs","polish":"prettier --write .","clean":"./script/clean"},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"yarn test && yarn build:esnext","prepare-commit-msg":"./script/has-message \"$1\" || ( exec < /dev/tty && git cz --hook )"}},"lint-staged":{"*.(js|cjs|mjs|json|yaml|yml|md|css|htm|htm|ts)":"prettier --write","*.json":"jq ."},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"sideEffects":false,"browserslist":["defaults, cover 95% and supports promises","not dead"],"licenseText":"This is free and unencumbered software released into the public domain.\n\nAnyone is free to copy, modify, publish, use, compile, sell, or\ndistribute this software, either in source code form or as a compiled\nbinary, for any purpose, commercial or non-commercial, and by any\nmeans.\n\nIn jurisdictions that recognize copyright laws, the author or authors\nof this software dedicate any and all copyright interest in the\nsoftware to the public domain. We make this dedication for the benefit\nof the public at large and to the detriment of our heirs and\nsuccessors. We intend this dedication to be an overt act of\nrelinquishment in perpetuity of all present and future rights to this\nsoftware under copyright law.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\nOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\nFor more information, please refer to <https://unlicense.org>\n","_id":"fun-promises@1.1.0-alpha.1","dist":{"shasum":"ea3a1b17eb6fb25b9841eb346d7f89252585b676","integrity":"sha512-Pn4MbPAjSSU2C1XV2eEtZc7Cv9bg3GO4kKsuNfTciaOkLnlnsykEIhNjQvr3AGBSBkzWeRTmcUn0PTU7G32Szg==","tarball":"https://registry.npmjs.org/fun-promises/-/fun-promises-1.1.0-alpha.1.tgz","fileCount":115,"unpackedSize":3826768,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxQOwCRA9TVsSAnZWagAAzXIQAIqHzuh7CZpz3cBm9f/s\na36010dWs3k6gZT4BM8YcZfiWlqg9PgYIxdfj6Rtzl8m5ottobRNPhUhZqFI\njTdHjDQ1yyUIvhNSQrdyu2n5jX5gALrcyU56PALb48VVDj8da2gFAi1Okx1/\nGRkNjtLK9Wx6L+7WTF8D7ivbLiDNw/jC3jF5YV1LUW9LlORXMr+kseAIWwoC\n2dl3qHYJAwDOy2fGfXtgv+2l4xxFipyW0/Uk9agtD6z3F3VXb9dPH1rq+5CP\n9WeYV4O1OwNXggRTSV9O0Yk02JGx6cokPXnL38SuQQ2Gk3b51HWtvt3FPSWY\nTLjABDyyhWq3tWo1KT50ejpyE1023y1F1Zw/gHirALwb7yh1WQ6dvu76D1f4\nrKP5d/MqqXm6ZsXNUmCwxOIz7JFo+oQSK18UD1D8VoROnCTjqinjM9VyN94s\nTCumuNP4v85bpZChyzTL1mLQwGLOhhP6g0FGz/E3vBd3RFTs2kU39Xw2q+oL\nMoRDxVtKLHaZhZb7IffeSg5XzDCwIUQrSgd8eTEIe03VHe6Mai9lD4YxBytj\nV1K2ME0nURHmmofl+thp1utzi2Gme82bpwQTmLj9em5Ws+mtuC+osns/vgNm\n8RC7/nEii25bOLdqT/WtZtVZ+tucH6xrkuhuNE+xeTgbx54JkQcIoYwtIvlu\nKZKu\r\n=fVP0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCTvFCfdKRM2JAlFGRJO4klQCpT33DC0K+fUWdm7PfxcQIgIzruYwovC/uhKdlAE26Ly4/xZjZDMLV1/PFZ1eWpyNQ="}]},"_npmUser":{"name":"robertfischer","email":"smokejumperit@gmail.com"},"directories":{},"maintainers":[{"name":"robertfischer","email":"smokejumperit@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fun-promises_1.1.0-alpha.1_1606747056190_0.4332711963236362"},"_hasShrinkwrap":false,"deprecated":"Deprecated in favor of 1.1.0-rc.2"},"1.1.0-rc.2":{"name":"fun-promises","version":"1.1.0-rc.2","description":"A library for making Promises more friendly, fluent, and fun(ctional).","main":"dist/node/v14/index.js","module":"dist/es6/esm/index.js","browser":"dist/browser/min/index.js","reactNative":"dist/rn/index.js","source":"index.ts","repository":{"type":"git","url":"git+ssh://git@github.com/RobertFischer/fun-promises.git"},"author":{"name":"Robert Fischer"},"license":"Unlicense","private":false,"keywords":["promise","performance","promises","promises-a","promises-aplus","async","await","deferred","deferreds","future","flow control","dsl","fluent interface","functional programming","functional"],"homepage":"https://robertfischer.github.io/fun-promises/","dependencies":{"@babel/runtime-corejs3":"^7.12.5","core-js":"^3.7.0","debug":"^4.2.0","lodash":"^4.17.20","tslib":"^2.0.3"},"devDependencies":{"@babel/cli":"^7.12.1","@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-runtime":"^7.12.1","@babel/preset-env":"^7.12.7","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/npm":"^7.0.6","@semantic-release/release-notes-generator":"^9.0.1","@tsconfig/node10":"^1.0.7","@tsconfig/node12":"^1.0.7","@tsconfig/node14":"^1.0.0","@tsconfig/react-native":"^1.0.2","@types/debug":"^4.1.5","@types/lodash":"^4.14.165","babel-minify":"^0.5.1","babel-plugin-import":"^1.13.3","babel-plugin-minify-dead-code-elimination":"^0.5.1","babel-plugin-minify-simplify":"^0.5.1","babel-plugin-remove-debug":"^0.0.4","conventional-changelog-conventionalcommits":"^4.5.0","cz-conventional-changelog":"^3.3.0","husky":"^4.3.0","jest":"^26.6.3","jest-extended":"^0.11.5","lint-staged":"^10.5.1","parcel":"^1.12.4","prettier":"^2.1.2","semantic-release":"^17.2.2","ts-jest":"^26.4.3","typedoc":"^0.19.2","typedoc-plugin-nojekyll":"^1.0.1","typescript":"^4.1.2"},"scripts":{"test":"jest --detectOpenHandles --forceExit ./*.test.js ./src/*.test.js","build:docs":"rm -rf ./docs && yarn build:docs:typedocs && yarn build:docs:changelog && yarn build:docs:test && yarn build:docs:coverage && mkdir -p ./dist && tar cavf ./dist/docs.tgz ./docs","build:docs:typedocs":"typedoc --tsconfig tsconfig.json","build:docs:changelog":"cp ./CHANGELOG.md ./docs/ || true","build:docs:test":"yarn test --verbose 2>&1 | tee ./docs/test-results.txt","build:docs:coverage":"mkdir -p ./docs && npx browserslist --update-db && (( echo 'Explicitly Supported Browsers (MUST support Promises)' && npx browserslist && npx browserslist --coverage && npx browserslist --coverage=US && echo 'Note that functionally equivalent but unlisted browsers do not count in these stats, so real coverage is much higher than the percentages reported.' ) | tee ./docs/coverage.txt)","watch:compile":"tsc --watch --noEmit -p tsconfig.json","watch:test":"yarn test --watch","build":"DEBUG='*' echo 'Executing build' && rm -rf dist && yarn build:esnext && yarn build:es6 && yarn build:node && yarn build:browser && yarn build:docs","build:esnext":"tsc -p tsconfig.json","build:es6":"yarn build:cjs && yarn build:esm && yarn build:umd && yarn build:amd","build:cjs":"tsc -p ./tsconfig/cjs.json","build:esm":"tsc -p ./tsconfig/esm.json","build:umd":"tsc -p ./tsconfig/umd.json","build:amd":"tsc -p ./tsconfig/amd.json","build:node":"yarn build:node:10 && yarn build:node:12 && yarn build:node:14","build:node:10":"tsc -p ./tsconfig/node10.json","build:node:12":"tsc -p ./tsconfig/node12.json","build:node:14":"tsc -p ./tsconfig/node14.json","build:browser":"yarn build:esnext && parcel build ./dist/esnext/index.js --target browser --out-dir ./dist/browser/ --global FunPromise --detailed-report 15","prepack":"echo 'Executing prepack' && yarn build","serve:docs":"yarn build:docs && http-server ./docs","polish":"prettier --write .","clean":"./script/clean"},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"yarn test && yarn build:esnext","prepare-commit-msg":"./script/has-message \"$1\" || ( exec < /dev/tty && git cz --hook )"}},"lint-staged":{"*.(js|cjs|mjs|json|yaml|yml|md|css|htm|htm|ts)":"prettier --write","*.json":"jq ."},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"sideEffects":false,"browserslist":["defaults, cover 95% and supports promises","not dead"],"readme":"<!-- @format -->\n\n# fun-promises\n\n## A library for making Promises more friendly, fluent, and fun(ctional).\n\n### What This Is Not\n\nThis is _not_ an implementation of [Promises/A+](https://promisesaplus.com/). It\nis not a polyfill or a [ponyfill](https://github.com/sindresorhus/ponyfill). In\nfact, it assumes that you have `Promise` available as a global, either through a\npolyfill or natively.\n\n### What This Is\n\nThis is a library that extends the native `Promise` implementation with a number\nof useful utilities, so that your code is faster and easier. It is inspired by\nlibraries like [`bluebird`](http://bluebirdjs.com/) and\n[`rsvp.js`](https://github.com/tildeio/rsvp.js/blob/master/README.md), except\nwithout the overhead of providing its own `Promise` implementation. Native\npromises have been competitive in performance since Node 10\n([even `bluebird` says so](https://www.npmjs.com/package/bluebird#note)) but\nthere's a lot of functionality which native `Promises` don't supply. Fun\nPromises gives you that better API without the overhead.\n\n### Some Highlights\n\nFor more details on these APIs, see\n[GitHub Pages](https://robertfischer.github.io/fun-promises/). You particularly\nmay want to check out\n[the BDD spec](http://robertfischer.github.io/fun-promises/test-results.txt).\n\n#### `Deferral` class\n\nThis is an inside-out promise: it gives you access to the `resolve` and `reject`\nmethods of the promise so that you can perform operations on them later, as well\nas having accessor to query the state of `promise`.\n\n#### `try`\n\nWrap your execution in a promise, so that even its invocation\n[won't release Zalgo](https://blog.izs.me/2013/08/designing-apis-for-asynchrony),\nor as a convinent way to build a `FunPromise` off of an `async` function.\n\n```typescript\nFunPromise.try(() => doSomething(explosivelyFailingParamCalculation()));\nFunPromise.try(async () => {\n\t/* do stuff */ await something; /* do more stuff */\n});\n```\n\n#### `tap`\n\nThis lets you take a look at a resolved value without risking changing it. This\nis extremely useful for debugging log messages.\n\n```typescript\nsomeExpensiveOperation()\n\t.tap((value) => debug(\"Value from someExpensiveOperation\", value))\n\t.then(/* ... */);\n```\n\n#### `race`\n\nFire off a bunch of promises and return whichever one resolves first. (The\nresults of any later-resolving promises are discarded.)\n\n```typescript\ngetRelatedShows().race((someShow) => renderSuggestedShow(someShow));\n```\n\n#### `coalesce`\n\nGiven a bunch of functions that return either values or promises of values,\nexecute them sequentially and return the first one what resolves.\n\n```typescript\nFunPromise.coalesce([\n\tlookupUserInMemoryCache,\n\tlookupUserInRedisCache,\n\tlookupUserInDB,\n]).then((data) => renderUserData(data));\n```\n\nThat code is equivalent to:\n\n```typescript\nFunPromise.resolve([\n\tlookupUserInMemoryCache,\n\tlookupUserInRedisCache,\n\tlookupUserInDB,\n])\n\t.coalesce()\n\t.then((data) => renderUserData);\n```\n\n#### Types\n\nThere are types that represent unwrapped promises (`Unpromise`), things that may\nbe promises or values (`Promisable`), and a few others that are a lot more\nesoteric.\n\n_NOTE_: Compiling these types requires TypeScript 4.1 or greater due to\nconditional recursive types being unavailable in 3.x and buggy in 4.0.x. As of\nthis writing, that means explicitly installing `typescript@^4.1.1-rc`, but\n[you can double-check the npm versions page yourself](https://www.npmjs.com/package/typescript?activeTab=versions).\n\n### Distributions\n\nBy default, your packager should automatically grab the appropriate distribution\nthrough the `package.json` configuration within this library. If you're curious\nor if you have a weird use case, then each distribution has a few different\nflavors of the codebase to choose from. These all live under the `./dist`\ndirectory.\n\n#### ESNext\n\nWithin `./dist/esnext` is the result of the Typescript compilation with the\n[\"ESNext\" `module` setting](https://www.typescriptlang.org/tsconfig#module) and\nthe [\"ESNext\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\nNote that it is subject to change as new ECMAScript standards are put out and\nTypescript's JavaScript generation continues to catch up to them, and mostly\nexists for developers to see code that results from compilation.\n\n#### ES6\n\nWithin `./dist/es6` are the folders `amd`, `umd`, `cjs` (CommonJS), and `esm`\n(ECMAScript Modules). These contain the result of the Typescript compilation\nwith the corresponding\n[`module` setting](https://www.typescriptlang.org/tsconfig#module) and the\n[\"ES6\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\n\nThe only single-file distribution is the `es6/amd` distribution.\n\n#### Node\n\nWithin `./dist/node` are the folders `v10`, `v12`, `v14`, each of which\ncontaining the Typescript compilation based on\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#node-10-tsconfigjson).\nfor those environments. All the versions are the exact same code as of this\nwriting, so we default Node to using `node/v14`.\n\n#### React Native\n\nWithin `./dist/rn` is the result of the Typescript compilation based on\n[the recommended `tsconfig.json` config for React Native](https://github.com/tsconfig/bases#react-native-tsconfigjson).\nThis is also referred to under the `reactNative` key in `package.json`, which\n[you should configure in your `metro.config.js` to prefer](https://facebook.github.io/metro/docs/configuration/#resolvermainfields).\n\n#### Browser\n\nThe file at `./dist/browser/index.js` is the result of transpiling the result of\nthe `ESNext` code above using [Parcel](http://parceljs.org/). The result is a\nsingle minified file, appropriate for use in a CDN. It exposes the module under\nthe global `FunPromise` namespace.\n\n### Documentation\n\nThe full documentation (including this content) is available on\n[GitHub Pages](https://robertfischer.github.io/fun-promises/).\n\n#### Specifications\n\nOur test specs are\n[published here](https://robertfischer.github.io/fun-promises/test-results.txt).\n\n### Contributing [ TODO ]\n\n#### Design Philosophy [ TODO ]\n","readmeFilename":"README.md","gitHead":"56c512b1a4072b1d9656c6c54fb36f0a85a43561","bugs":{"url":"https://github.com/RobertFischer/fun-promises/issues"},"_id":"fun-promises@1.1.0-rc.2","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-zgrZmWAJDL7V3Rli3iCDplr3femNQ+/7747SmVT5e4K0WkhpQQSeChGvBqYgk36ZP2qGShu5jELhouwzbLw0MQ==","shasum":"4f6e53654bf8cd80887f301bb52341ef5c44e7ab","tarball":"https://registry.npmjs.org/fun-promises/-/fun-promises-1.1.0-rc.2.tgz","fileCount":92,"unpackedSize":836346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfx8ULCRA9TVsSAnZWagAAXZQQAIUDvI7JoiK+1N5TfJf7\nrgRp5AbnKi12y74XZSuZjUErVPs9gCxJDfez/Yuw1C5lvlVWdiWKysYfepNm\n6Uunditvl7J0iHb3JYib2QPk+/Q/mIxzeGZTr3pV98V92vJ081yhQRyZIzje\nBKLsbQArjdqfrl9X6er2RQGO4xbh/ArTkd7GmvK+bAEqy01HvkXn15/Gpzyz\nPq1VVh79O9BWwqsrbyDdGJQKiKoiSflmUNIVkqfJ0Uuw/6SCVkLUI+jyR4Ky\n84q/m/yIi+XxYys+1bbB7XJMgNi39WayzmsXhcT3KnKCE4wzLJ4am1lp9Q4l\n7bG4iV6ocvhtV7AT1GhRfiMtKjVABGweVCeLdrFkMJ+Q5XE1oWs9PTMhVnZK\nGbArn/y6dD4I8txuZ3HCJBg4zx3Yutmyr1Eh7blvct+4IfUJbP9S6mUZr8EY\n7bJm1Kp2j4IYdx9dljY7G7mSWcp6jhaGWntHT0pwiVTvlyswe8WIxWb5Zs1Q\nwZRiLGWbcESXGP4fnMjOxVhtuIIVBQSB43qKgc3K7YkyoRmWTBqOL3pRe8EI\ngHBJB66gy0wkucp6/VC97EjzekDky8+fFawdpwJvoLISGncC2tXy2ekMxyR3\nYmpTBYgDpOi3Plx65rKuZqN4fWjsYfUutPg8EdvgtEe13Icn9bnCdMsrKWUC\nHrhp\r\n=OWL4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGfQhwpCUqG7poRgytx1s1yHMrXClKPJt1dqnGZOKwJNAiEAxnsiuMPz1e4ss3Qw4Ywnapdc2bfzSt07cfpR0uy9lq8="}]},"_npmUser":{"name":"robertfischer","email":"smokejumperit@gmail.com"},"directories":{},"maintainers":[{"name":"robertfischer","email":"smokejumperit@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fun-promises_1.1.0-rc.2_1606927627073_0.3126845012395416"},"_hasShrinkwrap":false},"1.2.0-rc.1":{"name":"fun-promises","version":"1.2.0-rc.1","description":"A library for making Promises more friendly, fluent, and fun(ctional).","main":"dist/node/v14/index.js","module":"dist/es6/esm/index.js","browser":"dist/browser/min/index.js","reactNative":"dist/rn/index.js","source":"index.ts","repository":{"type":"git","url":"git+ssh://git@github.com/RobertFischer/fun-promises.git"},"author":{"name":"Robert Fischer"},"license":"Unlicense","private":false,"keywords":["promise","performance","promises","promises-a","promises-aplus","async","await","deferred","deferreds","future","flow control","dsl","fluent interface","functional programming","functional"],"homepage":"https://robertfischer.github.io/fun-promises/","dependencies":{"@babel/runtime-corejs3":"^7.12.5","core-js":"^3.7.0","debug":"^4.2.0","lodash":"^4.17.20","tslib":"^2.0.3"},"devDependencies":{"@babel/cli":"^7.12.1","@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-runtime":"^7.12.1","@babel/preset-env":"^7.12.7","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/npm":"^7.0.6","@semantic-release/release-notes-generator":"^9.0.1","@tsconfig/node10":"^1.0.7","@tsconfig/node12":"^1.0.7","@tsconfig/node14":"^1.0.0","@tsconfig/react-native":"^1.0.2","@types/debug":"^4.1.5","@types/lodash":"^4.14.165","babel-minify":"^0.5.1","babel-plugin-import":"^1.13.3","babel-plugin-minify-dead-code-elimination":"^0.5.1","babel-plugin-minify-simplify":"^0.5.1","babel-plugin-remove-debug":"^0.0.4","conventional-changelog-conventionalcommits":"^4.5.0","cz-conventional-changelog":"^3.3.0","husky":"^4.3.0","jest":"^26.6.3","jest-extended":"^0.11.5","lint-staged":"^10.5.1","parcel":"^1.12.4","prettier":"^2.1.2","semantic-release":"^17.2.2","ts-jest":"^26.4.3","typedoc":"^0.19.2","typedoc-plugin-nojekyll":"^1.0.1","typescript":"^4.1.2"},"scripts":{"test":"jest --detectOpenHandles --forceExit ./*.test.js ./src/*.test.js","build:docs":"rm -rf ./docs && yarn build:docs:typedocs && yarn build:docs:changelog && yarn build:docs:test && yarn build:docs:coverage && mkdir -p ./dist && tar cavf ./dist/docs.tgz ./docs","build:docs:typedocs":"typedoc --tsconfig tsconfig.json","build:docs:changelog":"cp ./CHANGELOG.md ./docs/ || true","build:docs:test":"yarn test --verbose 2>&1 | tee ./docs/test-results.txt","build:docs:coverage":"mkdir -p ./docs && npx browserslist --update-db && (( echo 'Explicitly Supported Browsers (MUST support Promises)' && npx browserslist && npx browserslist --coverage && npx browserslist --coverage=US && echo 'Note that functionally equivalent but unlisted browsers do not count in these stats, so real coverage is much higher than the percentages reported.' ) | tee ./docs/coverage.txt)","watch:compile":"tsc --watch --noEmit -p tsconfig.json","watch:test":"yarn test --watch","build":"DEBUG='*' echo 'Executing build' && rm -rf dist && yarn build:esnext && yarn build:es6 && yarn build:node && yarn build:browser && yarn build:docs","build:esnext":"tsc -p tsconfig.json","build:es6":"yarn build:cjs && yarn build:esm && yarn build:umd && yarn build:amd","build:cjs":"tsc -p ./tsconfig/cjs.json","build:esm":"tsc -p ./tsconfig/esm.json","build:umd":"tsc -p ./tsconfig/umd.json","build:amd":"tsc -p ./tsconfig/amd.json","build:node":"yarn build:node:10 && yarn build:node:12 && yarn build:node:14","build:node:10":"tsc -p ./tsconfig/node10.json","build:node:12":"tsc -p ./tsconfig/node12.json","build:node:14":"tsc -p ./tsconfig/node14.json","build:browser":"yarn build:esnext && parcel build ./dist/esnext/index.js --target browser --out-dir ./dist/browser/ --global FunPromise --detailed-report 15","prepack":"echo 'Executing prepack' && yarn build","serve:docs":"yarn build:docs && http-server ./docs","polish":"prettier --write .","clean":"./script/clean"},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"yarn test && yarn build:esnext","prepare-commit-msg":"./script/has-message \"$1\" || ( exec < /dev/tty && git cz --hook )"}},"lint-staged":{"*.(js|cjs|mjs|json|yaml|yml|md|css|htm|htm|ts)":"prettier --write","*.json":"jq ."},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"sideEffects":false,"browserslist":["defaults, cover 95% and supports promises","not dead"],"readme":"<!-- @format -->\n\n# fun-promises\n\n## A library for making Promises more friendly, fluent, and fun(ctional).\n\n### What This Is Not\n\nThis is _not_ an implementation of [Promises/A+](https://promisesaplus.com/). It\nis not a polyfill or a [ponyfill](https://github.com/sindresorhus/ponyfill). In\nfact, it assumes that you have `Promise` available as a global, either through a\npolyfill or natively.\n\n### What This Is\n\nThis is a library that extends the native `Promise` implementation with a number\nof useful utilities, so that your code is faster and easier. It is inspired by\nlibraries like [`bluebird`](http://bluebirdjs.com/) and\n[`rsvp.js`](https://github.com/tildeio/rsvp.js/blob/master/README.md), except\nwithout the overhead of providing its own `Promise` implementation. Native\npromises have been competitive in performance since Node 10\n([even `bluebird` says so](https://www.npmjs.com/package/bluebird#note)) but\nthere's a lot of functionality which native `Promises` don't supply. Fun\nPromises gives you that better API without the overhead.\n\n### Some Highlights\n\nFor more details on these APIs, see\n[GitHub Pages](https://robertfischer.github.io/fun-promises/). You particularly\nmay want to check out\n[the BDD spec](http://robertfischer.github.io/fun-promises/test-results.txt).\n\n#### `Deferral` class\n\nThis is an inside-out promise: it gives you access to the `resolve` and `reject`\nmethods of the promise so that you can perform operations on them later, as well\nas having accessor to query the state of `promise`.\n\n#### `try`\n\nWrap your execution in a promise, so that even its invocation\n[won't release Zalgo](https://blog.izs.me/2013/08/designing-apis-for-asynchrony),\nor as a convinent way to build a `FunPromise` off of an `async` function.\n\n```typescript\nFunPromise.try(() => doSomething(explosivelyFailingParamCalculation()));\nFunPromise.try(async () => {\n\t/* do stuff */ await something; /* do more stuff */\n});\n```\n\n#### `tap`\n\nThis lets you take a look at a resolved value without risking changing it. This\nis extremely useful for debugging log messages.\n\n```typescript\nsomeExpensiveOperation()\n\t.tap((value) => debug(\"Value from someExpensiveOperation\", value))\n\t.then(/* ... */);\n```\n\n#### `race`\n\nFire off a bunch of promises and return whichever one resolves first. (The\nresults of any later-resolving promises are discarded.)\n\n```typescript\ngetRelatedShows().race((someShow) => renderSuggestedShow(someShow));\n```\n\n#### `coalesce`\n\nGiven a bunch of functions that return either values or promises of values,\nexecute them sequentially and return the first one what resolves.\n\n```typescript\nFunPromise.coalesce([\n\tlookupUserInMemoryCache,\n\tlookupUserInRedisCache,\n\tlookupUserInDB,\n]).then((data) => renderUserData(data));\n```\n\nThat code is equivalent to:\n\n```typescript\nFunPromise.resolve([\n\tlookupUserInMemoryCache,\n\tlookupUserInRedisCache,\n\tlookupUserInDB,\n])\n\t.coalesce()\n\t.then((data) => renderUserData);\n```\n\n#### Types\n\nThere are types that represent unwrapped promises (`Unpromise`), things that may\nbe promises or values (`Promisable`), and a few others that are a lot more\nesoteric.\n\n_NOTE_: Compiling these types requires TypeScript 4.1 or greater due to\nconditional recursive types being unavailable in 3.x and buggy in 4.0.x. As of\nthis writing, that means explicitly installing `typescript@^4.1.1-rc`, but\n[you can double-check the npm versions page yourself](https://www.npmjs.com/package/typescript?activeTab=versions).\n\n### Distributions\n\nBy default, your packager should automatically grab the appropriate distribution\nthrough the `package.json` configuration within this library. If you're curious\nor if you have a weird use case, then each distribution has a few different\nflavors of the codebase to choose from. These all live under the `./dist`\ndirectory.\n\n#### ESNext\n\nWithin `./dist/esnext` is the result of the Typescript compilation with the\n[\"ESNext\" `module` setting](https://www.typescriptlang.org/tsconfig#module) and\nthe [\"ESNext\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\nNote that it is subject to change as new ECMAScript standards are put out and\nTypescript's JavaScript generation continues to catch up to them, and mostly\nexists for developers to see code that results from compilation.\n\n#### ES6\n\nWithin `./dist/es6` are the folders `amd`, `umd`, `cjs` (CommonJS), and `esm`\n(ECMAScript Modules). These contain the result of the Typescript compilation\nwith the corresponding\n[`module` setting](https://www.typescriptlang.org/tsconfig#module) and the\n[\"ES6\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\n\nThe only single-file distribution is the `es6/amd` distribution.\n\n#### Node\n\nWithin `./dist/node` are the folders `v10`, `v12`, `v14`, each of which\ncontaining the Typescript compilation based on\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#node-10-tsconfigjson).\nfor those environments. All the versions are the exact same code as of this\nwriting, so we default Node to using `node/v14`.\n\n#### React Native\n\nWithin `./dist/rn` is the result of the Typescript compilation based on\n[the recommended `tsconfig.json` config for React Native](https://github.com/tsconfig/bases#react-native-tsconfigjson).\nThis is also referred to under the `reactNative` key in `package.json`, which\n[you should configure in your `metro.config.js` to prefer](https://facebook.github.io/metro/docs/configuration/#resolvermainfields).\n\n#### Browser\n\nThe file at `./dist/browser/index.js` is the result of transpiling the result of\nthe `ESNext` code above using [Parcel](http://parceljs.org/). The result is a\nsingle minified file, appropriate for use in a CDN. It exposes the module under\nthe global `FunPromise` namespace.\n\n### Documentation\n\nThe full documentation (including this content) is available on\n[GitHub Pages](https://robertfischer.github.io/fun-promises/).\n\n#### Specifications\n\nOur test specs are\n[published here](https://robertfischer.github.io/fun-promises/test-results.txt).\n\n### Contributing [ TODO ]\n\n#### Design Philosophy [ TODO ]\n","readmeFilename":"README.md","gitHead":"e166b1a87d7e432848b78e0053ed4e2aa5049c92","bugs":{"url":"https://github.com/RobertFischer/fun-promises/issues"},"_id":"fun-promises@1.2.0-rc.1","_nodeVersion":"14.15.1","_npmVersion":"6.14.9","dist":{"integrity":"sha512-4DaXvMhfYc5FhhpqMUfzPMoISYMOZkedW6ubCQPTGI1af+o3ch1ZNL/kz0WETxNI2AHEIzwx/Fu8OkpMcAdMhQ==","shasum":"188fef343fa4264467ed94975c6bdfd40c4a759c","tarball":"https://registry.npmjs.org/fun-promises/-/fun-promises-1.2.0-rc.1.tgz","fileCount":92,"unpackedSize":836814,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfx84QCRA9TVsSAnZWagAA63IP/00HOx9DVDbvrNPxv05w\nCX1rrssfMszoDgHq4dMCjNTvX7Z/+fPKdx5Qt3b8mIdQK/Uv6FsFZjNO9Sca\nVUdzKBESwzynT6L7rpyIf07gQjxIUEM2nyDK8IliP7+zhD3fLjqpRsPjH/4D\nPrgegSdCmMneUtlPGTM49Xh5jmzcmQZvR9J3l5sFjnSLvRh2wdrQp6cna1D4\nmbLwx2pxJ7NdgD9RahAo7yv4ktEj7Up7tUHGscSvCwAgJP6R39qoL33W/+RW\nAVLQhZh3iwighcE/l+Bn65QwrZrb+ScwvF81NVqJ6RHX2fsFlBOiw1hxACxN\nE3HvXVVbSqUaKdp9YjXa/zHUcCekCvbeySOS5a/ZKI5r6mywmBKQWm0tSOYW\ncOHJvaln5Rmf1JDFLFS05R1LvauChJL7+g0G8ZWjy/T5ujIC2cHv/tOjrIpt\nFDOPxEMxp2NvkTH4pOYrC05lYiHUNRlsGvIJg6fqMqk1fSDldrhkwiaBRHAd\nIQgW8GZvchR/xkqpDBJ98yeBJObFBTV0yCIn7nsq7Dd8HZEYAHbo5hnV6sHZ\n6g7ppx0vqVNuX6pf1sN+HicIZNArfVLpDUOGVpqbRbfVkOmVTcxRsj+czW2G\nsERWYkeEoAMa2s3b1AQfVSInX8eT7/4z9CQTtOskJIuOyXG16ZFLo1CP20T9\nuTJb\r\n=RSMn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBeA6eHVoQ2dflGgbFWjULD5GzmeHk1HDF2PUy9kS8jgAiEA83u8wgZkq/HxcyfKA/PhTfp+nR3mQ8oQ8zDleEaxC2M="}]},"_npmUser":{"name":"robertfischer","email":"smokejumperit@gmail.com"},"directories":{},"maintainers":[{"name":"robertfischer","email":"smokejumperit@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fun-promises_1.2.0-rc.1_1606929936353_0.7636359356925355"},"_hasShrinkwrap":false,"deprecated":"Deprecated in favor of 1.1.0-rc.2"},"1.2.0-rc.2":{"name":"fun-promises","version":"1.2.0-rc.2","description":"A library for making Promises more friendly, fluent, and fun(ctional).","main":"dist/node/v14/index.js","module":"dist/es6/esm/index.js","browser":"dist/browser/min/index.js","reactNative":"dist/rn/index.js","source":"index.ts","repository":{"type":"git","url":"git+ssh://git@github.com/RobertFischer/fun-promises.git"},"author":{"name":"Robert Fischer"},"license":"Unlicense","private":false,"keywords":["promise","performance","promises","promises-a","promises-aplus","async","await","deferred","deferreds","future","flow control","dsl","fluent interface","functional programming","functional"],"homepage":"https://robertfischer.github.io/fun-promises/","dependencies":{"@babel/runtime-corejs3":"^7.12.5","core-js":"^3.7.0","debug":"^4.2.0","lodash":"^4.17.20","tslib":"^2.0.3"},"devDependencies":{"@babel/cli":"^7.12.1","@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-runtime":"^7.12.1","@babel/preset-env":"^7.12.7","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/npm":"^7.0.6","@semantic-release/release-notes-generator":"^9.0.1","@tsconfig/node10":"^1.0.7","@tsconfig/node12":"^1.0.7","@tsconfig/node14":"^1.0.0","@tsconfig/react-native":"^1.0.2","@types/debug":"^4.1.5","@types/lodash":"^4.14.165","babel-minify":"^0.5.1","babel-plugin-import":"^1.13.3","babel-plugin-minify-dead-code-elimination":"^0.5.1","babel-plugin-minify-simplify":"^0.5.1","babel-plugin-remove-debug":"^0.0.4","conventional-changelog-conventionalcommits":"^4.5.0","cz-conventional-changelog":"^3.3.0","husky":"^4.3.0","jest":"^26.6.3","jest-extended":"^0.11.5","lint-staged":"^10.5.1","parcel":"^1.12.4","prettier":"^2.1.2","semantic-release":"^17.2.2","ts-jest":"^26.4.3","typedoc":"^0.19.2","typedoc-plugin-nojekyll":"^1.0.1","typescript":"^4.1.2"},"scripts":{"test":"jest --detectOpenHandles --forceExit ./*.test.js ./src/*.test.js","build:docs":"rm -rf ./docs && yarn build:docs:typedocs && yarn build:docs:changelog && yarn build:docs:test && yarn build:docs:coverage && mkdir -p ./dist && tar cavf ./dist/docs.tgz ./docs","build:docs:typedocs":"typedoc --tsconfig tsconfig.json","build:docs:changelog":"cp ./CHANGELOG.md ./docs/ || true","build:docs:test":"yarn test --verbose 2>&1 | tee ./docs/test-results.txt","build:docs:coverage":"mkdir -p ./docs && npx browserslist --update-db && (( echo 'Explicitly Supported Browsers (MUST support Promises)' && npx browserslist && npx browserslist --coverage && npx browserslist --coverage=US && echo 'Note that functionally equivalent but unlisted browsers do not count in these stats, so real coverage is much higher than the percentages reported.' ) | tee ./docs/coverage.txt)","watch:compile":"tsc --watch --noEmit -p tsconfig.json","watch:test":"yarn test --watch","build":"DEBUG='*' echo 'Executing build' && rm -rf dist && yarn build:esnext && yarn build:es6 && yarn build:node && yarn build:browser && yarn build:docs","build:esnext":"tsc -p tsconfig.json","build:es6":"yarn build:cjs && yarn build:esm && yarn build:umd && yarn build:amd","build:cjs":"tsc -p ./tsconfig/cjs.json","build:esm":"tsc -p ./tsconfig/esm.json","build:umd":"tsc -p ./tsconfig/umd.json","build:amd":"tsc -p ./tsconfig/amd.json","build:node":"yarn build:node:10 && yarn build:node:12 && yarn build:node:14","build:node:10":"tsc -p ./tsconfig/node10.json","build:node:12":"tsc -p ./tsconfig/node12.json","build:node:14":"tsc -p ./tsconfig/node14.json","build:browser":"yarn build:esnext && parcel build ./dist/esnext/index.js --target browser --out-dir ./dist/browser/ --global FunPromise --detailed-report 15","prepack":"echo 'Executing prepack' && yarn build","serve:docs":"yarn build:docs && http-server ./docs","polish":"prettier --write .","clean":"./script/clean"},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"yarn test && yarn build:esnext","prepare-commit-msg":"./script/has-message \"$1\" || ( exec < /dev/tty && git cz --hook )"}},"lint-staged":{"*.(js|cjs|mjs|json|yaml|yml|md|css|htm|htm|ts)":"prettier --write","*.json":"jq ."},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"sideEffects":false,"browserslist":["defaults, cover 95% and supports promises","not dead"],"readme":"<!-- @format -->\n\n# fun-promises\n\n## A library for making Promises more friendly, fluent, and fun(ctional).\n\n### What This Is Not\n\nThis is _not_ an implementation of [Promises/A+](https://promisesaplus.com/). It\nis not a polyfill or a [ponyfill](https://github.com/sindresorhus/ponyfill). In\nfact, it assumes that you have `Promise` available as a global, either through a\npolyfill or natively.\n\n### What This Is\n\nThis is a library that extends the native `Promise` implementation with a number\nof useful utilities, so that your code is faster and easier. It is inspired by\nlibraries like [`bluebird`](http://bluebirdjs.com/) and\n[`rsvp.js`](https://github.com/tildeio/rsvp.js/blob/master/README.md), except\nwithout the overhead of providing its own `Promise` implementation. Native\npromises have been competitive in performance since Node 10\n([even `bluebird` says so](https://www.npmjs.com/package/bluebird#note)) but\nthere's a lot of functionality which native `Promises` don't supply. Fun\nPromises gives you that better API without the overhead.\n\n### Some Highlights\n\nFor more details on these APIs, see\n[GitHub Pages](https://robertfischer.github.io/fun-promises/). You particularly\nmay want to check out\n[the BDD spec](http://robertfischer.github.io/fun-promises/test-results.txt).\n\n#### `Deferral` class\n\nThis is an inside-out promise: it gives you access to the `resolve` and `reject`\nmethods of the promise so that you can perform operations on them later, as well\nas having accessor to query the state of `promise`.\n\n#### `try`\n\nWrap your execution in a promise, so that even its invocation\n[won't release Zalgo](https://blog.izs.me/2013/08/designing-apis-for-asynchrony),\nor as a convinent way to build a `FunPromise` off of an `async` function.\n\n```typescript\nFunPromise.try(() => doSomething(explosivelyFailingParamCalculation()));\nFunPromise.try(async () => {\n\t/* do stuff */ await something; /* do more stuff */\n});\n```\n\n#### `tap`\n\nThis lets you take a look at a resolved value without risking changing it. This\nis extremely useful for debugging log messages.\n\n```typescript\nsomeExpensiveOperation()\n\t.tap((value) => debug(\"Value from someExpensiveOperation\", value))\n\t.then(/* ... */);\n```\n\n#### `race`\n\nFire off a bunch of promises and return whichever one resolves first. (The\nresults of any later-resolving promises are discarded.)\n\n```typescript\ngetRelatedShows().race((someShow) => renderSuggestedShow(someShow));\n```\n\n#### `coalesce`\n\nGiven a bunch of functions that return either values or promises of values,\nexecute them sequentially and return the first one what resolves.\n\n```typescript\nFunPromise.coalesce([\n\tlookupUserInMemoryCache,\n\tlookupUserInRedisCache,\n\tlookupUserInDB,\n]).then((data) => renderUserData(data));\n```\n\nThat code is equivalent to:\n\n```typescript\nFunPromise.resolve([\n\tlookupUserInMemoryCache,\n\tlookupUserInRedisCache,\n\tlookupUserInDB,\n])\n\t.coalesce()\n\t.then((data) => renderUserData);\n```\n\n#### Types\n\nThere are types that represent unwrapped promises (`Unpromise`), things that may\nbe promises or values (`Promisable`), and a few others that are a lot more\nesoteric.\n\n_NOTE_: Compiling these types requires TypeScript 4.1 or greater due to\nconditional recursive types being unavailable in 3.x and buggy in 4.0.x. As of\nthis writing, that means explicitly installing `typescript@^4.1.1-rc`, but\n[you can double-check the npm versions page yourself](https://www.npmjs.com/package/typescript?activeTab=versions).\n\n### Distributions\n\nBy default, your packager should automatically grab the appropriate distribution\nthrough the `package.json` configuration within this library. If you're curious\nor if you have a weird use case, then each distribution has a few different\nflavors of the codebase to choose from. These all live under the `./dist`\ndirectory.\n\n#### ESNext\n\nWithin `./dist/esnext` is the result of the Typescript compilation with the\n[\"ESNext\" `module` setting](https://www.typescriptlang.org/tsconfig#module) and\nthe [\"ESNext\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\nNote that it is subject to change as new ECMAScript standards are put out and\nTypescript's JavaScript generation continues to catch up to them, and mostly\nexists for developers to see code that results from compilation.\n\n#### ES6\n\nWithin `./dist/es6` are the folders `amd`, `umd`, `cjs` (CommonJS), and `esm`\n(ECMAScript Modules). These contain the result of the Typescript compilation\nwith the corresponding\n[`module` setting](https://www.typescriptlang.org/tsconfig#module) and the\n[\"ES6\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\n\nThe only single-file distribution is the `es6/amd` distribution.\n\n#### Node\n\nWithin `./dist/node` are the folders `v10`, `v12`, `v14`, each of which\ncontaining the Typescript compilation based on\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#node-10-tsconfigjson).\nfor those environments. All the versions are the exact same code as of this\nwriting, so we default Node to using `node/v14`.\n\n#### React Native\n\nWithin `./dist/rn` is the result of the Typescript compilation based on\n[the recommended `tsconfig.json` config for React Native](https://github.com/tsconfig/bases#react-native-tsconfigjson).\nThis is also referred to under the `reactNative` key in `package.json`, which\n[you should configure in your `metro.config.js` to prefer](https://facebook.github.io/metro/docs/configuration/#resolvermainfields).\n\n#### Browser\n\nThe file at `./dist/browser/index.js` is the result of transpiling the result of\nthe `ESNext` code above using [Parcel](http://parceljs.org/). The result is a\nsingle minified file, appropriate for use in a CDN. It exposes the module under\nthe global `FunPromise` namespace.\n\n### Documentation\n\nThe full documentation (including this content) is available on\n[GitHub Pages](https://robertfischer.github.io/fun-promises/).\n\n#### Specifications\n\nOur test specs are\n[published here](https://robertfischer.github.io/fun-promises/test-results.txt).\n\n### Contributing [ TODO ]\n\n#### Design Philosophy [ TODO ]\n","readmeFilename":"README.md","gitHead":"787dcc07aeff598eec22bc467f7c8b55bca45b34","bugs":{"url":"https://github.com/RobertFischer/fun-promises/issues"},"_id":"fun-promises@1.2.0-rc.2","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ilCMdRACHSpnYtmYnpxS1YbdUjmfD2pfTAI2tV1iS6n3w2MYTF5zGWAdbS9XrowAFjakvzothtxoz7362KuL3Q==","shasum":"827545a28d930f6ee8faf8b8533ed205dc1a6f16","tarball":"https://registry.npmjs.org/fun-promises/-/fun-promises-1.2.0-rc.2.tgz","fileCount":92,"unpackedSize":870107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfx+MBCRA9TVsSAnZWagAAh0YQAJFh1VqHFl+tAd28sffp\nTd8DrIfiOdTUdvubIHex19qcJLC7tzd9MVxzK/612eCXgOedtAXHmY5rDDfX\nBD2LCOKQoPyYNgq+9Hnmo7Nv2E7teDC5ywYLsmSjtAC+dCZFmxAotYjr+8tl\nLw9jQnyv6FLonitDiIr+BjyueiCvw1tifFr6FoP1VNSF2BvbJfU1MPmPugZA\nwTX1FB3yj1lwLptgEFbm182SmF49eMViWM8J2rO3XLEJFqI6AShNfFR93xeG\n1voLIgAtOdFfjpKcIK8gePBhawG06DwlTSCYYArC/q9mQW3vQBSpsMtNXo9Q\nGOkudE1deTlqMHivlL2sLF/MH+N5k5zkXauYJyeGNMrPFfn+MozKrSVRMhYM\n9fM5fPIBpBnpWZe5CcFfmgJOgbdvP9P37l9estXrBzXG3l0BwXCP3iK5VTjF\nXrQfgqNOe1ASG+LXt8/DRuiZpMfMp5Cy7RMW7Q+OsTvRIIOkal+c52Ef9ssm\nrxAr3Cc+bUEKT7D1XwDLHyqbPgcRETNQd87MtGD8+ZfT3aSVO2mj/h2oER1C\nbPtXm24E5pxQu8/xsQDqdT8P0SCoe7pcxS9ete1AzDqji3GS3gavlDITz832\nH52+g57G8DaoFlQqK9HIKrmcbDxZpDeyJ5bW1PvQRQrWSVDSb/EBtnsWpbWd\nQkc/\r\n=c48p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICZxUAPZlMd3Jt823bjcTTfgiOQzVChCH6zRJonNfhqWAiEAwzvNCVT2NIKovTtqpz7p1EDJUUFxMbsb/pzrtb84fZg="}]},"_npmUser":{"name":"robertfischer","email":"smokejumperit@gmail.com"},"directories":{},"maintainers":[{"name":"robertfischer","email":"smokejumperit@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fun-promises_1.2.0-rc.2_1606935296947_0.8463242502820405"},"_hasShrinkwrap":false,"deprecated":"Deprecated in favor of 1.1.0-rc.2"},"1.2.0":{"name":"fun-promises","version":"1.2.0","description":"A library for making Promises more friendly, fluent, and fun(ctional).","main":"dist/node/v14/index.js","module":"dist/es6/esm/index.js","browser":"dist/browser/min/index.js","reactNative":"dist/rn/index.js","source":"index.ts","repository":{"type":"git","url":"git+ssh://git@github.com/RobertFischer/fun-promises.git"},"author":{"name":"Robert Fischer"},"license":"Unlicense","private":false,"keywords":["promise","performance","promises","promises-a","promises-aplus","async","await","deferred","deferreds","future","flow control","dsl","fluent interface","functional programming","functional"],"homepage":"https://robertfischer.github.io/fun-promises/","dependencies":{"@babel/runtime-corejs3":"^7.12.5","core-js":"^3.7.0","debug":"^4.2.0","lodash":"^4.17.20","tslib":"^2.0.3"},"devDependencies":{"@babel/cli":"^7.12.1","@babel/core":"^7.12.3","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-runtime":"^7.12.1","@babel/preset-env":"^7.12.7","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/npm":"^7.0.6","@semantic-release/release-notes-generator":"^9.0.1","@tsconfig/node10":"^1.0.7","@tsconfig/node12":"^1.0.7","@tsconfig/node14":"^1.0.0","@tsconfig/react-native":"^1.0.2","@types/debug":"^4.1.5","@types/lodash":"^4.14.165","babel-minify":"^0.5.1","babel-plugin-import":"^1.13.3","babel-plugin-minify-dead-code-elimination":"^0.5.1","babel-plugin-minify-simplify":"^0.5.1","babel-plugin-remove-debug":"^0.0.4","conventional-changelog-conventionalcommits":"^4.5.0","cz-conventional-changelog":"^3.3.0","husky":"^4.3.0","jest":"^26.6.3","jest-extended":"^0.11.5","lint-staged":"^10.5.1","parcel":"^1.12.4","prettier":"^2.1.2","semantic-release":"^17.2.2","ts-jest":"^26.4.3","typedoc":"^0.19.2","typedoc-plugin-nojekyll":"^1.0.1","typescript":"^4.1.2"},"scripts":{"test":"jest --detectOpenHandles --forceExit ./*.test.js ./src/*.test.js","build:docs":"rm -rf ./docs && yarn build:docs:typedocs && yarn build:docs:changelog && yarn build:docs:test && yarn build:docs:coverage && mkdir -p ./dist && tar cavf ./dist/docs.tgz ./docs","build:docs:typedocs":"typedoc --tsconfig tsconfig.json --gitRevision \"$(git rev-parse --short HEAD)\"","build:docs:changelog":"cp ./CHANGELOG.md ./docs/ || true","build:docs:test":"yarn test --verbose 2>&1 | tee ./docs/test-results.txt","build:docs:coverage":"mkdir -p ./docs && npx browserslist --update-db && (( echo 'Explicitly Supported Browsers (MUST support Promises)' && npx browserslist && npx browserslist --coverage && npx browserslist --coverage=US && echo 'Note that functionally equivalent but unlisted browsers do not count in these stats, so real coverage is much higher than the percentages reported.' ) | tee ./docs/coverage.txt)","watch:compile":"tsc --watch --noEmit -p tsconfig.json","watch:test":"yarn test --watch","build":"DEBUG='*' echo 'Executing build' && rm -rf dist && yarn build:esnext && yarn build:es6 && yarn build:node && yarn build:browser && yarn build:docs","build:esnext":"tsc -p tsconfig.json","build:es6":"yarn build:cjs && yarn build:esm && yarn build:umd && yarn build:amd","build:cjs":"tsc -p ./tsconfig/cjs.json","build:esm":"tsc -p ./tsconfig/esm.json","build:umd":"tsc -p ./tsconfig/umd.json","build:amd":"tsc -p ./tsconfig/amd.json","build:node":"yarn build:node:10 && yarn build:node:12 && yarn build:node:14","build:node:10":"tsc -p ./tsconfig/node10.json","build:node:12":"tsc -p ./tsconfig/node12.json","build:node:14":"tsc -p ./tsconfig/node14.json","build:browser":"yarn build:esnext && parcel build ./dist/esnext/index.js --target browser --out-dir ./dist/browser/ --global FunPromise --detailed-report 15","prepack":"echo 'Executing prepack' && yarn build","serve:docs":"yarn build:docs && npx http-server ./docs","polish":"prettier --write .","clean":"./script/clean"},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"yarn test && yarn build:esnext","prepare-commit-msg":"./script/has-message \"$1\" || ( exec < /dev/tty && git cz --hook )"}},"lint-staged":{"*.(js|cjs|mjs|json|yaml|yml|md|css|htm|htm|ts)":"prettier --write","*.json":"jq ."},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"sideEffects":false,"browserslist":["defaults, cover 95% and supports promises","not dead"],"gitHead":"153c3dc06898d11b0c76af568074afbbe51bff75","bugs":{"url":"https://github.com/RobertFischer/fun-promises/issues"},"_id":"fun-promises@1.2.0","_nodeVersion":"14.15.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-gqjVYR8P7EV/KEXnsv+tt5EGi43hd8sN6CNklR7IiLcmiDY29SFcOYcQ1z1p4SQ4OTkCr9vc3RkIEa6IV7m5/Q==","shasum":"2e70b486789bb632427e6c1989f1f6090dfcb2af","tarball":"https://registry.npmjs.org/fun-promises/-/fun-promises-1.2.0.tgz","fileCount":92,"unpackedSize":871122,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfySVbCRA9TVsSAnZWagAAcpEP/inJBXaTB8TN+9FaxNFj\ntMY9YnC7MfFefxLHcGMKguWqj60qrT681Z7ujdoXMhMU8q9kw89At67Ljhw3\nRL02V11Bo+GTKWTj3yJ3rrwCmYt57TSm0PxNIlU3yK6prirbldJ/mjRENXKm\nTNOpMucQKI2tH5ZagvRTSDa+VzGCBjy2yC8p6/nmsxd3TqkMXbndfYTqLiIu\nFQimKX8lKMAHfiwoGbvc3AOn6VfVQq4Nv5+bimnB4sPjm5bZ9gmEuT+vFipM\nXr77b6cv+dMLrRA4PYzgAAa7psftlgw352QETyeqQ0Ifn6Gg5ZN3esTma4rk\ndi8l1IcsycRkvoyzby+1gMkfW8tRL5REX3fVwbtLQxXGPqCIh5loE3vogBcP\nc0h/ihcmD9lCoirUJx8VLqPjnOgdgwsh+/RarXUrb68Px+YA/kYzj+1aElQg\n3JzA1Bz+Np0/QTzTaRbigHazx5r1uZrEt7TTanAlfdUuZRHDAsFD45oW30o3\nlVeuP75gchePlk3aFdvTPOIyHmiSURa1SY86XRB0DEmalyrql5ITC0REyzCl\nzy/bioKglSaKDfqV69OSAuRZmm7FK5+WTK4ShtvDoqTiXugtGdNfIDqNCLYQ\n0wg3bL4e82S05ZI48XaQkWj7AcpXdByJVTJeEOvbFV+UaiZFXewNfguAp8Dw\nq9BB\r\n=Lrfg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFBH5E/9kXBNl0NWEDHGHXxtZI1QIwzNzXwJxoUgl1WRAiAG2Ro8lN9fmc1VUyz8+arbfKkLC7JV6uIltnbV+9Iwew=="}]},"_npmUser":{"name":"robertfischer","email":"smokejumperit@gmail.com"},"directories":{},"maintainers":[{"name":"robertfischer","email":"smokejumperit@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fun-promises_1.2.0_1607017819031_0.145235029223727"},"_hasShrinkwrap":false,"deprecated":"Deprecated in favor of 1.1.0-rc.2"},"1.4.0-rc.1":{"name":"fun-promises","version":"1.4.0-rc.1","description":"A library for making Promises more friendly, fluent, and fun(ctional).","main":"dist/node/v14/index.js","module":"dist/es6/esm/index.js","browser":"dist/browser/index.js","reactNative":"dist/react-native/index.js","source":"index.ts","repository":{"type":"git","url":"git+ssh://git@github.com/RobertFischer/fun-promises.git"},"author":{"name":"Robert Fischer"},"license":"Unlicense","private":false,"keywords":["promise","performance","promises","promises-a","promises-aplus","async","await","deferred","deferreds","future","flow control","dsl","fluent interface","functional programming","functional"],"homepage":"https://robertfischer.github.io/fun-promises/","dependencies":{"@babel/runtime-corejs3":"^7.12.5","@robertfischer/ts-nested-error":"^1.2.0","core-js":"^3.8.0","debug":"^4.3.1","lodash":"^4.17.20","tslib":"^2.0.3"},"devDependencies":{"@babel/cli":"^7.12.8","@babel/core":"^7.12.9","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-runtime":"^7.12.1","@babel/preset-env":"^7.12.7","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/github":"^7.2.0","@semantic-release/npm":"^7.0.9","@semantic-release/release-notes-generator":"^9.0.1","@tsconfig/node10":"^1.0.7","@tsconfig/node12":"^1.0.7","@tsconfig/node14":"^1.0.0","@tsconfig/react-native":"^1.0.2","@types/debug":"^4.1.5","@types/lodash":"^4.14.165","babel-minify":"^0.5.1","babel-plugin-import":"^1.13.3","babel-plugin-minify-dead-code-elimination":"^0.5.1","babel-plugin-minify-simplify":"^0.5.1","babel-plugin-remove-debug":"^0.0.4","conventional-changelog-conventionalcommits":"^4.5.0","cz-conventional-changelog":"^3.3.0","husky":"^4.3.1","jest":"^26.6.3","jest-extended":"^0.11.5","lint-staged":"^10.5.3","parcel":"^1.12.4","prettier":"^2.2.1","semantic-release":"^17.3.0","semantic-release-npm-deprecate-old-versions":"^1.0.1","ts-jest":"^26.4.4","typedoc":"^0.19.2","typedoc-plugin-nojekyll":"^1.0.1","typescript":"^4.1.2"},"scripts":{"build":"echo 'Executing build' && yarn build:dists && yarn build:docs","build:amd":"tsc -p ./tsconfig/amd.json","build:browser":"( test -d ./dist/esnext || yarn build:esnext ) && parcel build ./dist/esnext/index.js --target browser --out-dir ./dist/browser/ --global FunPromise --detailed-report 15","build:bundle":"./script/bootstrap && yarn build:dists && ./script/bundle-dists","build:cjs":"tsc -p ./tsconfig/cjs.json","build:dists":"rm -rf dist && yarn build:esnext && yarn build:es6 && yarn build:node && yarn build:react-native && yarn build:browser","build:docs":"rm -rf ./docs && yarn build:docs:typedocs && yarn build:docs:changelog && yarn build:docs:test && yarn build:docs:coverage && mkdir -p ./dist && tar cJvf ./dist/docs.tar.xz ./docs","build:docs:changelog":"cp ./CHANGELOG.md ./docs/ || true","build:docs:coverage":"mkdir -p ./docs && npx browserslist --update-db && (( echo 'Explicitly Supported Browsers (MUST support Promises)' && npx browserslist && npx browserslist --coverage && npx browserslist --coverage=US && echo 'Note that functionally equivalent but unlisted browsers do not count in these stats, so real coverage is much higher than the percentages reported.' ) | tee ./docs/coverage.txt)","build:docs:test":"yarn test --verbose 2>&1 | tee ./docs/test-results.txt","build:docs:typedocs":"typedoc --tsconfig tsconfig.json --gitRevision \"$(git rev-parse --short HEAD)\"","build:es6":"yarn build:cjs && yarn build:esm && yarn build:umd && yarn build:amd","build:esm":"tsc -p ./tsconfig/esm.json","build:esnext":"tsc -p tsconfig.json","build:node":"yarn build:node:10 && yarn build:node:12 && yarn build:node:14","build:node:10":"tsc -p ./tsconfig/node10.json","build:node:12":"tsc -p ./tsconfig/node12.json","build:node:14":"tsc -p ./tsconfig/node14.json","build:react-native":"tsc -p ./tsconfig/react-native.json","build:umd":"tsc -p ./tsconfig/umd.json","bump-deps":"yarn upgrade -LCA && yarn install && yarn test","clean":"./script/clean","polish":"prettier --write .","prepack":"echo 'Executing prepack' && yarn build:dists","serve:docs":"yarn build:docs && npx http-server ./docs","test":"jest --detectOpenHandles --forceExit ./*.test.js ./src/*.test.js","watch:compile":"tsc --watch --noEmit -p tsconfig.json","watch:test":"yarn test --watch"},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"yarn test && yarn build:esnext","prepare-commit-msg":"./script/has-message \"$1\" || ( exec < /dev/tty && git cz --hook )"}},"lint-staged":{"*.(js|cjs|mjs|json|yaml|yml|md|css|htm|htm|ts)":"prettier --write","*.json":"jq ."},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"sideEffects":false,"browserslist":["defaults, cover 95% and supports promises","not dead"],"readme":"<!-- @format -->\n\n# fun-promises\n\n## A library for making Promises more friendly, fluent, and fun(ctional).\n\n### What This Is Not\n\nThis is _not_ an implementation of [Promises/A+](https://promisesaplus.com/). It\nis not a polyfill or a [ponyfill](https://github.com/sindresorhus/ponyfill). In\nfact, it assumes that you have `Promise` available as a global, either through a\npolyfill or natively.\n\n### What This Is\n\nThis is a library that extends the native `Promise` implementation with a number\nof useful utilities, so that your code is faster and easier. It is inspired by\nlibraries like [`bluebird`](http://bluebirdjs.com/) and\n[`rsvp.js`](https://github.com/tildeio/rsvp.js/blob/master/README.md), except\nwithout the overhead of providing its own `Promise` implementation. Native\npromises have been competitive in performance since Node 10\n([even `bluebird` says so](https://www.npmjs.com/package/bluebird#note)) but\nthere's a lot of functionality which native `Promises` don't supply. Fun\nPromises gives you that better API without the overhead.\n\n### API\n\n- [FunPromise](http://robertfischer.github.io/fun-promises/classes/_src_fun_promise_.funpromise.html)\n- [Deferral](http://robertfischer.github.io/fun-promises/modules/_src_deferral_.deferral.html)\n- [Types](http://robertfischer.github.io/fun-promises/modules/_src_types_.html)\n\nYou also may want to check out\n[the BDD spec](http://robertfischer.github.io/fun-promises/test-results.txt),\nwhich gives an overview of how we expect these things to work.\n\n### Some Highlights\n\n#### `Deferral` class\n\nThis is an inside-out promise: it gives you access to the `resolve` and `reject`\nmethods of the promise so that you can perform operations on them later, as well\nas having accessor to query the state of `promise`.\n\n#### `try`\n\n```typescript\nFunPromise.try(() => doSomething(explosivelyFailingParamCalculation()));\nFunPromise.try(async () => {\n\t/* do stuff */ await something; /* do more stuff */\n});\n```\n\nWrap your execution in a promise, so that even its invocation\n[won't release Zalgo](https://blog.izs.me/2013/08/designing-apis-for-asynchrony),\nor as a convinent way to build a `FunPromise` off of an `async` function.\n\n#### `tap`\n\n```typescript\nsomeExpensiveOperation()\n\t.tap((value) => debug(\"Value from someExpensiveOperation\", value))\n\t.then(/* ... */);\n```\n\nThis lets you take a look at a resolved value without risking changing it. This\nis extremely useful for debugging log messages.\n\n#### `race`\n\n```typescript\ngetRelatedShows().race((someShow) => renderSuggestedShow(someShow));\n```\n\nFire off a bunch of promises and return whichever one resolves first. (The\nresults of any later-resolving promises are discarded.)\n\n#### `coalesce`\n\n```typescript\nFunPromise.coalesce([\n\tlookupUserInMemoryCache,\n\tlookupUserInRedisCache,\n\tlookupUserInDB,\n]).then((data) => renderUserData(data));\n```\n\nGiven a bunch of functions that return either values or promises of values,\nexecute them sequentially and return the first one what resolves.\n\n#### Types\n\nThere are types that represent unwrapped promise values\n([`Unpromise`](https://robertfischer.github.io/fun-promises/modules/_src_types_.html#unpromise)),\nthings that may be promises or values\n([`Promisable`](https://robertfischer.github.io/fun-promises/modules/_src_types_.html#promisable)),\nand\n[a few others that are a lot more esoteric](https://robertfischer.github.io/fun-promises/modules/_src_types_.html).\n\n_NOTE_: Compiling these types requires a recent version of TypeScript (4.1 or\ngreater) due to conditional recursive types being unavailable in 3.x and buggy\nin 4.0.x.\n\n### Distributions\n\nBy default, your packager should automatically grab the appropriate distribution\nthrough the `package.json` configuration within this library. If you're curious\nor if you have a weird use case, then each distribution has a few different\nflavors of the codebase to choose from. These all live under the `./dist`\ndirectory.\n\n#### ESNext\n\nWithin `./dist/esnext` is the result of the Typescript compilation with the\n[\"ESNext\" `module` setting](https://www.typescriptlang.org/tsconfig#module) and\nthe [\"ESNext\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\nNote that it is subject to change as new ECMAScript standards are put out and\nTypescript's JavaScript generation continues to catch up to them, and mostly\nexists for developers to see code that results from compilation.\n\n#### ES6\n\nWithin `./dist/es6` are the folders `amd`, `umd`, `cjs` (CommonJS), and `esm`\n(ECMAScript Modules). These contain the result of the Typescript compilation\nwith the corresponding\n[`module` setting](https://www.typescriptlang.org/tsconfig#module) and the\n[\"ES6\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\n\nThe only single-file distribution is the `es6/amd` distribution.\n\n#### Node\n\nWithin `./dist/node` are the folders `v10`, `v12`, `v14`, each of which\ncontaining the Typescript compilation based on\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#node-10-tsconfigjson).\nfor those environments. All the versions are the exact same code as of this\nwriting, so we default Node to using `node/v14`.\n\n#### Browser\n\nThe file at `./dist/browser/index.js` is the result of transpiling the result of\nthe `ESNext` code above using [Parcel](http://parceljs.org/). The result is a\nsingle minified file, appropriate for use in a CDN. It exposes the module under\nthe global `FunPromise` namespace.\n\n#### React Native\n\nWithin `./dist/react-native` is the result of transpiling the result with\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#react-native-tsconfigjson)\nfor React Native. The distribution is specified in `package.json` under the\n`\"reactNative\"` key,\n[which you can configure Metro to prefer](https://facebook.github.io/metro/docs/configuration/#resolvermainfields).\n\n### Documentation\n\nThe full documentation (including this content) is available on\n[GitHub Pages](https://robertfischer.github.io/fun-promises/).\n\n#### Specifications\n\nOur test specs are\n[published here](https://robertfischer.github.io/fun-promises/test-results.txt).\n\n### Contributing [ TODO ]\n\n#### Design Philosophy [ TODO ]\n","readmeFilename":"README.md","gitHead":"7b4899b0bbe2eba1480c4d278377bcae39a401b6","bugs":{"url":"https://github.com/RobertFischer/fun-promises/issues"},"_id":"fun-promises@1.4.0-rc.1","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-GUYjLumb1qvEo37mgcpoxp0xPJZx3NhX7a42z2NRnHOczdaREkwEpOKthqVtbC99VS7Xzain6YVO6tZWxHQxdw==","shasum":"6b7e54984cfd73b5e8ba5cbb8ada4028fc31c0ae","tarball":"https://registry.npmjs.org/fun-promises/-/fun-promises-1.4.0-rc.1.tgz","fileCount":112,"unpackedSize":971062,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfytjeCRA9TVsSAnZWagAAW0EP/1O0j3JPvCwCMSdhdW+s\nt65iOlXe1njb9bvvN13/qyzlO6xWUHgzi+FbC3HW6MH7mu9O16np1wZt+Ciy\nkWdOLFV0BLa3oqLcBT/kNf00t/l/vas6bKiEV2aUZ4HmsXYqTiQZ45B2e69m\nX97oJ9HQt4U5dqh614F+smXWzZXNYw+B0LZA0RQWhfF4vK+IJb2cFaa+56d3\niAu4wbbSWSHD20fvISHFU/OSSqsABf3EECWsM+a+aMguRL9aplyHZLbDU7rp\nqSKvw/lqOkByk9g3B7/LbWVv7Qf+lmgQxiCT4AKSWGz3vse7G/+RyFJrh7ek\neZ8K3hG2X7zkktiBponKr4RiGk7tjOjhl9tVvArWSTlgURzYXTxT31GrFjt2\nU42i0yX44CuDbTqJAvr2xOqHgBM1HJcBxSmtMl6AMs7NrV0l1lyCzGsP+HT8\nM4ls7t2wsXLpy5hPi6m5UxpbzdQ97sABn0GkBXJeZwfVwpdtYFYH4w07N0bb\ndPe3U00s0SVJoSWwn2bK3jbQkC9I88gwiLg0QRlr7LhCte3d5WrNx7VZKuHA\nylfm0Uhi39z/xQqUxuXr48ytwqHl/eKAves06sF7S9EDElmzY/C1DycSgBpV\nCAyXAVlFLSV+e45Dvmn+j8r1WrJRfhpaRj3smqNwOEZONPUpDCxA2ouWuCFX\n1xU1\r\n=gb7x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDIZvd84TzDcjunUjpRVbeOZW3ixo+/MNgKXEeYwbTbQwIhAIOn9sup4T50BYFya/bvUZ/b9mVPUFRUNIbNGtvvu7Pr"}]},"_npmUser":{"name":"robertfischer","email":"smokejumperit@gmail.com"},"directories":{},"maintainers":[{"name":"robertfischer","email":"smokejumperit@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fun-promises_1.4.0-rc.1_1607129310264_0.2608602582927344"},"_hasShrinkwrap":false,"deprecated":"Deprecated in favor of 1.1.0-rc.2"},"1.4.0":{"name":"fun-promises","version":"1.4.0","description":"A library for making Promises more friendly, fluent, and fun(ctional).","main":"dist/node/v14/index.js","module":"dist/es6/esm/index.js","browser":"dist/browser/index.js","reactNative":"dist/react-native/index.js","source":"index.ts","repository":{"type":"git","url":"git+ssh://git@github.com/RobertFischer/fun-promises.git"},"author":{"name":"Robert Fischer"},"license":"Unlicense","private":false,"keywords":["promise","performance","promises","promises-a","promises-aplus","async","await","deferred","deferreds","future","flow control","dsl","fluent interface","functional programming","functional"],"homepage":"https://robertfischer.github.io/fun-promises/","dependencies":{"@babel/runtime-corejs3":"^7.12.5","@robertfischer/ts-nested-error":"^1.2.0","core-js":"^3.8.0","debug":"^4.3.1","lodash":"^4.17.20","tslib":"^2.0.3"},"devDependencies":{"@babel/cli":"^7.12.8","@babel/core":"^7.12.9","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-runtime":"^7.12.1","@babel/preset-env":"^7.12.7","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/github":"^7.2.0","@semantic-release/npm":"^7.0.9","@semantic-release/release-notes-generator":"^9.0.1","@tsconfig/node10":"^1.0.7","@tsconfig/node12":"^1.0.7","@tsconfig/node14":"^1.0.0","@tsconfig/react-native":"^1.0.2","@types/debug":"^4.1.5","@types/lodash":"^4.14.165","babel-minify":"^0.5.1","babel-plugin-import":"^1.13.3","babel-plugin-minify-dead-code-elimination":"^0.5.1","babel-plugin-minify-simplify":"^0.5.1","babel-plugin-remove-debug":"^0.0.4","conventional-changelog-conventionalcommits":"^4.5.0","cz-conventional-changelog":"^3.3.0","husky":"^4.3.1","jest":"^26.6.3","jest-extended":"^0.11.5","lint-staged":"^10.5.3","parcel":"^1.12.4","prettier":"^2.2.1","semantic-release":"^17.3.0","semantic-release-npm-deprecate-old-versions":"^1.0.1","ts-jest":"^26.4.4","typedoc":"^0.19.2","typedoc-plugin-nojekyll":"^1.0.1","typescript":"^4.1.2"},"scripts":{"build":"echo 'Executing build' && yarn build:dists && yarn build:docs","build:amd":"tsc -p ./tsconfig/amd.json","build:browser":"( test -d ./dist/esnext || yarn build:esnext ) && parcel build ./dist/esnext/index.js --target browser --out-dir ./dist/browser/ --global FunPromise --detailed-report 15","build:bundle":"./script/bootstrap && yarn build:dists && ./script/bundle-dists","build:cjs":"tsc -p ./tsconfig/cjs.json","build:dists":"rm -rf dist && yarn build:esnext && yarn build:es6 && yarn build:node && yarn build:react-native && yarn build:browser","build:docs":"rm -rf ./docs && yarn build:docs:typedocs && yarn build:docs:changelog && yarn build:docs:test && yarn build:docs:coverage && mkdir -p ./dist && tar cJvf ./dist/docs.tar.xz ./docs","build:docs:changelog":"cp ./CHANGELOG.md ./docs/ || true","build:docs:coverage":"mkdir -p ./docs && npx browserslist --update-db && (( echo 'Explicitly Supported Browsers (MUST support Promises)' && npx browserslist && npx browserslist --coverage && npx browserslist --coverage=US && echo 'Note that functionally equivalent but unlisted browsers do not count in these stats, so real coverage is much higher than the percentages reported.' ) | tee ./docs/coverage.txt)","build:docs:test":"yarn test --verbose 2>&1 | tee ./docs/test-results.txt","build:docs:typedocs":"typedoc --tsconfig tsconfig.json --gitRevision \"$(git rev-parse --short HEAD)\"","build:es6":"yarn build:cjs && yarn build:esm && yarn build:umd && yarn build:amd","build:esm":"tsc -p ./tsconfig/esm.json","build:esnext":"tsc -p tsconfig.json","build:node":"yarn build:node:10 && yarn build:node:12 && yarn build:node:14","build:node:10":"tsc -p ./tsconfig/node10.json","build:node:12":"tsc -p ./tsconfig/node12.json","build:node:14":"tsc -p ./tsconfig/node14.json","build:react-native":"tsc -p ./tsconfig/react-native.json","build:umd":"tsc -p ./tsconfig/umd.json","bump-deps":"yarn upgrade -LCA && yarn install && yarn test","clean":"./script/clean","polish":"prettier --write .","prepack":"echo 'Executing prepack' && yarn build:dists","serve:docs":"yarn build:docs && npx http-server ./docs","test":"jest --detectOpenHandles --forceExit ./*.test.js ./src/*.test.js","watch:compile":"tsc --watch --noEmit -p tsconfig.json","watch:test":"yarn test --watch"},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"yarn test && yarn build:esnext","prepare-commit-msg":"./script/has-message \"$1\" || ( exec < /dev/tty && git cz --hook )"}},"lint-staged":{"*.(js|cjs|mjs|json|yaml|yml|md|css|htm|htm|ts)":"prettier --write","*.json":"jq ."},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"sideEffects":false,"browserslist":["defaults, cover 95% and supports promises","not dead"],"gitHead":"38c6e068486a5ab560cfd334b6e66cc2cdfab2bd","bugs":{"url":"https://github.com/RobertFischer/fun-promises/issues"},"_id":"fun-promises@1.4.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-2hdPGa6M190vpgK6n3xcOUzLfbSe6bMN9rCEo/QlhqOFLoJL0bvPF0Ar6Kob0YbhOl9AdixlNrkrNf1q7GKJ6Q==","shasum":"60a9f0692213b572c0340f9a83be8e805ded400c","tarball":"https://registry.npmjs.org/fun-promises/-/fun-promises-1.4.0.tgz","fileCount":112,"unpackedSize":971047,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfytmBCRA9TVsSAnZWagAAerIP/jg/NJVx7N3IbqpFC/sM\n0fvPCnVTn+T5YI2hP8Ry0SNPnm1kiqVillpCkzokMuVtBIjoDb/AVULFNgy5\nq2nvRCKkTUgkL6d3yqeVNZFkcTKVaXLyILmmR2jhvICF++CwL4r0lY3ebkub\nCZO68ufTpML7iENAJg+hAZrsnhXZ7mXrMtaYTPO21isKpt0A/Xy9z4Arx5fC\n5nhlwgouPLdOcFwIS0oWTvjVQf9dI0YjpEKKc7CkcWQ2I+ghlTlRNvKF7R90\nz7vjLkZu/05gZn0VhuN/m7RhoyzNARugP6CS+0Fj7BjZwxFEQ7fevqHbI4wj\nriLiroIrQjpQkSFDBFb/nh++z3v/yCI+CfG6IyDQLY8Di9/QJPBzTmQ7LBpo\nup62KQsuEZuA6VuaWpBEhQ51rM9rgsGx7y/ZZp6VRclAUol+RK4jCh8BFmUA\nYyRAsjJQ4SVo9vC+II+InwbWeWarBKOdabFqo45UUjPfkLRUW0tHkN9k9j4A\nHs/DZuT+8cd6yi2ZKOgd4oB4k/Kuq/tTsUJQdeg3GsLkzbtY2qnWT3yVFTmn\nGUDS6ohvxMp/407Mcb4urpgSqs4wo3p/WCgZeRGCEV91ZIhLbCTZA1ZqFI1X\norXcs3nWnXHWYU3t4fjACOmBDCIVX8ZOTdAXFV9mY9KJaZz6+vNpXSipC1BO\nVUfR\r\n=lCSL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFh00F+hdzVKsDf4pltR9NnPaKlUdJvFIcZvNHhGgIcbAiEA4eQkiRUxk9/y/1NWNq2PILd58QlQ2SZ3pgezgfkTppc="}]},"_npmUser":{"name":"robertfischer","email":"smokejumperit@gmail.com"},"directories":{},"maintainers":[{"name":"robertfischer","email":"smokejumperit@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fun-promises_1.4.0_1607129472835_0.2204877941736083"},"_hasShrinkwrap":false,"deprecated":"Deprecated in favor of 1.1.0-rc.2"},"1.4.0-rc.2":{"name":"fun-promises","version":"1.4.0-rc.2","description":"A library for making Promises more friendly, fluent, and fun(ctional).","main":"dist/node/v14/index.js","module":"dist/es6/esm/index.js","browser":"dist/browser/index.js","reactNative":"dist/react-native/index.js","source":"index.ts","repository":{"type":"git","url":"git+ssh://git@github.com/RobertFischer/fun-promises.git"},"author":{"name":"Robert Fischer"},"license":"Unlicense","private":false,"keywords":["async","await","bluebird","deferred","deferreds","flow control","functional programming","functional","future","futures","promise","promises","promises-a","promises-aplus","typescript"],"homepage":"https://robertfischer.github.io/fun-promises/","dependencies":{"@babel/runtime-corejs3":"^7.12.5","core-js":"^3.8.0","debug":"^4.3.1","lodash":"^4.17.20","ts-nested-error":"^1.2.1","tslib":"^2.0.3"},"devDependencies":{"@babel/cli":"^7.12.8","@babel/core":"^7.12.9","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-runtime":"^7.12.1","@babel/preset-env":"^7.12.7","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/github":"^7.2.0","@semantic-release/npm":"^7.0.9","@semantic-release/release-notes-generator":"^9.0.1","@tsconfig/node10":"^1.0.7","@tsconfig/node12":"^1.0.7","@tsconfig/node14":"^1.0.0","@tsconfig/react-native":"^1.0.2","@types/debug":"^4.1.5","@types/lodash":"^4.14.165","babel-minify":"^0.5.1","babel-plugin-import":"^1.13.3","babel-plugin-minify-dead-code-elimination":"^0.5.1","babel-plugin-minify-simplify":"^0.5.1","babel-plugin-remove-debug":"^0.0.4","conventional-changelog-conventionalcommits":"^4.5.0","cz-conventional-changelog":"^3.3.0","husky":"^4.3.4","jest":"^26.6.3","jest-extended":"^0.11.5","lint-staged":"^10.5.3","parcel":"^1.12.4","prettier":"^2.2.1","semantic-release":"^17.3.0","semantic-release-npm-deprecate-old-versions":"^1.0.1","ts-jest":"^26.4.4","typedoc":"^0.19.2","typedoc-plugin-nojekyll":"^1.0.1","typescript":"^4.1.2"},"scripts":{"build":"echo 'Executing build' && yarn build:dists && yarn build:docs","build:amd":"tsc -p ./tsconfig/amd.json","build:browser":"( test -d ./dist/esnext || yarn build:esnext ) && parcel build ./dist/esnext/index.js --target browser --out-dir ./dist/browser/ --global FunPromise --detailed-report 15","build:bundle":"./script/bootstrap && yarn build:dists && ./script/bundle-dists","build:cjs":"tsc -p ./tsconfig/cjs.json","build:dists":"rm -rf dist && yarn build:esnext && yarn build:es6 && yarn build:node && yarn build:react-native && yarn build:browser","build:docs":"rm -rf ./docs && yarn build:docs:typedocs && yarn build:docs:changelog && yarn build:docs:test && yarn build:docs:coverage && mkdir -p ./dist && tar cJvf ./dist/docs.tar.xz ./docs","build:docs:changelog":"cp ./CHANGELOG.md ./docs/ || true","build:docs:coverage":"mkdir -p ./docs && npx browserslist --update-db && (( echo 'Explicitly Supported Browsers (MUST support Promises)' && npx browserslist && npx browserslist --coverage && npx browserslist --coverage=US && echo 'Note that functionally equivalent but unlisted browsers do not count in these stats, so real coverage is much higher than the percentages reported.' ) | tee ./docs/coverage.txt)","build:docs:test":"yarn test --verbose 2>&1 | tee ./docs/test-results.txt","build:docs:typedocs":"typedoc --tsconfig tsconfig.json --gitRevision \"$(git rev-parse --short HEAD)\"","build:es6":"yarn build:cjs && yarn build:esm && yarn build:umd && yarn build:amd","build:esm":"tsc -p ./tsconfig/esm.json","build:esnext":"tsc -p tsconfig.json","build:node":"yarn build:node:10 && yarn build:node:12 && yarn build:node:14","build:node:10":"tsc -p ./tsconfig/node10.json","build:node:12":"tsc -p ./tsconfig/node12.json","build:node:14":"tsc -p ./tsconfig/node14.json","build:react-native":"tsc -p ./tsconfig/react-native.json","build:umd":"tsc -p ./tsconfig/umd.json","bump-deps":"yarn upgrade -LCA && yarn install && yarn test","clean":"./script/clean","polish":"prettier --write .","prepack":"echo 'Executing prepack' && yarn build:dists","serve:docs":"yarn build:docs && npx http-server ./docs","test":"jest --detectOpenHandles --forceExit ./*.test.js ./src/*.test.js","watch:compile":"tsc --watch --noEmit -p tsconfig.json","watch:test":"yarn test --watch"},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"yarn test && yarn build:esnext","prepare-commit-msg":"./script/has-message \"$1\" || ( exec < /dev/tty && git cz --hook )"}},"lint-staged":{"*.(js|cjs|mjs|json|yaml|yml|md|css|htm|htm|ts)":"prettier --write","*.json":"jq ."},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"sideEffects":false,"browserslist":["defaults, cover 95% and supports promises","not dead"],"readme":"<!-- @format -->\n\n# fun-promises\n\n## A library for making Promises more friendly, fluent, and fun(ctional).\n\n### What This Is Not\n\nThis is _not_ an implementation of [Promises/A+](https://promisesaplus.com/). It\nis not a polyfill or a [ponyfill](https://github.com/sindresorhus/ponyfill). In\nfact, it assumes that you have `Promise` available as a global, either through a\npolyfill or natively.\n\n### What This Is\n\nThis is a library that extends the native `Promise` implementation with a number\nof useful utilities, so that your code is faster and easier. It is inspired by\nlibraries like [`bluebird`](http://bluebirdjs.com/) and\n[`rsvp.js`](https://github.com/tildeio/rsvp.js/blob/master/README.md), except\nwithout the overhead of providing its own `Promise` implementation. Native\npromises have been competitive in performance since Node 10\n([even `bluebird` says so](https://www.npmjs.com/package/bluebird#note)) but\nthere's a lot of functionality which native `Promises` don't supply. Fun\nPromises gives you that better API without the overhead.\n\n### API\n\n- [FunPromise](http://robertfischer.github.io/fun-promises/classes/_src_fun_promise_.funpromise.html)\n- [Deferral](http://robertfischer.github.io/fun-promises/modules/_src_deferral_.deferral.html)\n- [Types](http://robertfischer.github.io/fun-promises/modules/_src_types_.html)\n\nYou also may want to check out\n[the BDD spec](http://robertfischer.github.io/fun-promises/test-results.txt),\nwhich gives an overview of how we expect these things to work.\n\n### Some Highlights\n\n#### `Deferral` class\n\nThis is an inside-out promise: it gives you access to the `resolve` and `reject`\nmethods of the promise so that you can perform operations on them later, as well\nas having accessor to query the state of `promise`.\n\n#### `try`\n\n```typescript\nFunPromise.try(() => doSomething(explosivelyFailingParamCalculation()));\nFunPromise.try(async () => {\n\t/* do stuff */ await something; /* do more stuff */\n});\n```\n\nWrap your execution in a promise, so that even its invocation\n[won't release Zalgo](https://blog.izs.me/2013/08/designing-apis-for-asynchrony),\nor as a convinent way to build a `FunPromise` off of an `async` function.\n\n#### `tap`\n\n```typescript\nsomeExpensiveOperation()\n\t.tap((value) => debug(\"Value from someExpensiveOperation\", value))\n\t.then(/* ... */);\n```\n\nThis lets you take a look at a resolved value without risking changing it. This\nis extremely useful for debugging log messages.\n\n#### `race`\n\n```typescript\ngetRelatedShows().race((someShow) => renderSuggestedShow(someShow));\n```\n\nFire off a bunch of promises and return whichever one resolves first. (The\nresults of any later-resolving promises are discarded.)\n\n#### `coalesce`\n\n```typescript\nFunPromise.coalesce([\n\tlookupUserInMemoryCache,\n\tlookupUserInRedisCache,\n\tlookupUserInDB,\n]).then((data) => renderUserData(data));\n```\n\nGiven a bunch of functions that return either values or promises of values,\nexecute them sequentially and return the first one what resolves.\n\n#### Types\n\nThere are types that represent unwrapped promise values\n([`Unpromise`](https://robertfischer.github.io/fun-promises/modules/_src_types_.html#unpromise)),\nthings that may be promises or values\n([`Promisable`](https://robertfischer.github.io/fun-promises/modules/_src_types_.html#promisable)),\nand\n[a few others that are a lot more esoteric](https://robertfischer.github.io/fun-promises/modules/_src_types_.html).\n\n_NOTE_: Compiling these types requires a recent version of TypeScript (4.1 or\ngreater) due to conditional recursive types being unavailable in 3.x and buggy\nin 4.0.x.\n\n### Distributions\n\nBy default, your packager should automatically grab the appropriate distribution\nthrough the `package.json` configuration within this library. If you're curious\nor if you have a weird use case, then each distribution has a few different\nflavors of the codebase to choose from. These all live under the `./dist`\ndirectory.\n\n#### ESNext\n\nWithin `./dist/esnext` is the result of the Typescript compilation with the\n[\"ESNext\" `module` setting](https://www.typescriptlang.org/tsconfig#module) and\nthe [\"ESNext\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\nNote that it is subject to change as new ECMAScript standards are put out and\nTypescript's JavaScript generation continues to catch up to them, and mostly\nexists for developers to see code that results from compilation.\n\n#### ES6\n\nWithin `./dist/es6` are the folders `amd`, `umd`, `cjs` (CommonJS), and `esm`\n(ECMAScript Modules). These contain the result of the Typescript compilation\nwith the corresponding\n[`module` setting](https://www.typescriptlang.org/tsconfig#module) and the\n[\"ES6\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\n\nThe only single-file distribution is the `es6/amd` distribution.\n\n#### Node\n\nWithin `./dist/node` are the folders `v10`, `v12`, `v14`, each of which\ncontaining the Typescript compilation based on\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#node-10-tsconfigjson).\nfor those environments. All the versions are the exact same code as of this\nwriting, so we default Node to using `node/v14`.\n\n#### Browser\n\nThe file at `./dist/browser/index.js` is the result of transpiling the result of\nthe `ESNext` code above using [Parcel](http://parceljs.org/). The result is a\nsingle minified file, appropriate for use in a CDN. It exposes the module under\nthe global `FunPromise` namespace.\n\n#### React Native\n\nWithin `./dist/react-native` is the result of transpiling the result with\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#react-native-tsconfigjson)\nfor React Native. The distribution is specified in `package.json` under the\n`\"reactNative\"` key,\n[which you can configure Metro to prefer](https://facebook.github.io/metro/docs/configuration/#resolvermainfields).\n\n### Documentation\n\nThe full documentation (including this content) is available on\n[GitHub Pages](https://robertfischer.github.io/fun-promises/).\n\n#### Specifications\n\nOur test specs are\n[published here](https://robertfischer.github.io/fun-promises/test-results.txt).\n\n### Contributing [ TODO ]\n\n#### Design Philosophy [ TODO ]\n","readmeFilename":"README.md","gitHead":"28345d722c346f595eb82b4b03d7867d08ceaffb","bugs":{"url":"https://github.com/RobertFischer/fun-promises/issues"},"_id":"fun-promises@1.4.0-rc.2","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-rwuaZXnEyLy/wwAS9UvLBTdC1uk3rovJNQUy7BqaBm23OP3QUoK0SkD2dD6UJxNOnb7E1iCpkSgKeTL/K9e7zw==","shasum":"8a6e82c57ce1a6073eb754b651e56206b6aaa491","tarball":"https://registry.npmjs.org/fun-promises/-/fun-promises-1.4.0-rc.2.tgz","fileCount":112,"unpackedSize":1002435,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfy/PfCRA9TVsSAnZWagAACPAP/RcyvpwGIi+yNpc3UJwD\nUYo8FQXoNVZyPMVHgw7A2vw8d9UJAJ9qodSGJJ+rl/ZiI2e6YHU1ByTIyWtJ\nlkM/kUW+ECBitN28srh5FmSj26rgTuD+ZXJjFFsAzwdIFS0JhcgboqGKOv4Z\naUg2mg9v6fs6ASzc8BBk4xPg9SFCFKiswaFvfty5E7iT1QVtcqwlE4kHxnsA\nANGF42vykncuZHFFgbvWaUjgHxV6iYbMNN8Eres3DvQH1erH6XJnrbmQts0+\nHKArDhMcq50XLzpcxCUzSXG8a3CYwOyzitY4d+lS51ZLKyWOYqjPCyzoY8V7\n+OzPCyDmzUVKuwato4bczatYIN2VZ0Tg/ECpeXd8zeq406WPhVameTmVQEEJ\nK1Znt4H0jjjBvarJsN7iA9wLHidhbwtMnDYax9T5VkFNuZ/rcCd2d9QmdoAD\nB3K/OkVR2iCTmhM7qGuT4jwE1HxhRzjWGiXf9BW7DeYOkzEeYkQrHXZOmYf1\nkGdXrcny6NonYsb5iZ+VMJRvr6NbcJOB0HUMfASSpllK7Ui41M3oS3Q6g6pv\nWR0Rw4yvN/YLwaSrYRoYozI3DXvDpUMa8DDEjqIbcAOu/K58E7zWd6sQj/Gd\nFRbScee+z9HFPBkHqDVHZeupECW+rnN3F7E/qLwdkaTG5ic40UpSnSDyrs0E\nW5HZ\r\n=RXqa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDNEFOMPm3e1h3Ag/VNRqTO2TZrXAzp/SZ8ILKhdsoUXAIhAIM78nSg/RVYBvrZ5409CXHaj51hM0p6LCjv3F4wluCh"}]},"_npmUser":{"name":"robertfischer","email":"smokejumperit@gmail.com"},"directories":{},"maintainers":[{"name":"robertfischer","email":"smokejumperit@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fun-promises_1.4.0-rc.2_1607201758990_0.6537572935744709"},"_hasShrinkwrap":false,"deprecated":"Deprecated in favor of 1.1.0-rc.2"},"1.5.0":{"name":"fun-promises","version":"1.5.0","description":"A library for making Promises more friendly, fluent, and fun(ctional).","main":"dist/node/v14/index.js","module":"dist/es6/esm/index.js","browser":"dist/browser/index.js","reactNative":"dist/react-native/index.js","source":"index.ts","repository":{"type":"git","url":"git+ssh://git@github.com/RobertFischer/fun-promises.git"},"author":{"name":"Robert Fischer"},"license":"Unlicense","private":false,"keywords":["async","await","bluebird","deferred","deferreds","flow control","functional programming","functional","future","futures","promise","promises","promises-a","promises-aplus","typescript"],"homepage":"https://robertfischer.github.io/fun-promises/","dependencies":{"@babel/runtime-corejs3":"^7.12.5","core-js":"^3.8.0","debug":"^4.3.1","lodash":"^4.17.20","ts-nested-error":"^1.2.1","tslib":"^2.0.3"},"devDependencies":{"@babel/cli":"^7.12.8","@babel/core":"^7.12.9","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-runtime":"^7.12.1","@babel/preset-env":"^7.12.7","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/github":"^7.2.0","@semantic-release/npm":"^7.0.9","@semantic-release/release-notes-generator":"^9.0.1","@tsconfig/node10":"^1.0.7","@tsconfig/node12":"^1.0.7","@tsconfig/node14":"^1.0.0","@tsconfig/react-native":"^1.0.2","@types/debug":"^4.1.5","@types/lodash":"^4.14.165","babel-minify":"^0.5.1","babel-plugin-import":"^1.13.3","babel-plugin-minify-dead-code-elimination":"^0.5.1","babel-plugin-minify-simplify":"^0.5.1","babel-plugin-remove-debug":"^0.0.4","conventional-changelog-conventionalcommits":"^4.5.0","cz-conventional-changelog":"^3.3.0","husky":"^4.3.4","jest":"^26.6.3","jest-extended":"^0.11.5","lint-staged":"^10.5.3","parcel":"^1.12.4","prettier":"^2.2.1","semantic-release":"^17.3.0","semantic-release-npm-deprecate-old-versions":"^1.0.1","ts-jest":"^26.4.4","typedoc":"^0.19.2","typedoc-plugin-nojekyll":"^1.0.1","typescript":"^4.1.2"},"scripts":{"build":"echo 'Executing build' && yarn build:dists && yarn build:docs","build:amd":"tsc -p ./tsconfig/amd.json","build:browser":"( test -d ./dist/esnext || yarn build:esnext ) && parcel build ./dist/esnext/index.js --target browser --out-dir ./dist/browser/ --global FunPromise --detailed-report 15","build:bundle":"./script/bootstrap && yarn build:dists && ./script/bundle-dists","build:cjs":"tsc -p ./tsconfig/cjs.json","build:dists":"rm -rf dist && yarn build:esnext && yarn build:es6 && yarn build:node && yarn build:react-native && yarn build:browser","build:docs":"rm -rf ./docs && yarn build:docs:typedocs && yarn build:docs:changelog && yarn build:docs:test && yarn build:docs:coverage && mkdir -p ./dist && tar cJvf ./dist/docs.tar.xz ./docs","build:docs:changelog":"cp ./CHANGELOG.md ./docs/ || true","build:docs:coverage":"mkdir -p ./docs && npx browserslist --update-db && (( echo 'Explicitly Supported Browsers (MUST support Promises)' && npx browserslist && npx browserslist --coverage && npx browserslist --coverage=US && echo 'Note that functionally equivalent but unlisted browsers do not count in these stats, so real coverage is much higher than the percentages reported.' ) | tee ./docs/coverage.txt)","build:docs:test":"yarn test --verbose 2>&1 | tee ./docs/test-results.txt","build:docs:typedocs":"typedoc --tsconfig tsconfig.json --gitRevision \"$(git rev-parse --short HEAD)\"","build:es6":"yarn build:cjs && yarn build:esm && yarn build:umd && yarn build:amd","build:esm":"tsc -p ./tsconfig/esm.json","build:esnext":"tsc -p tsconfig.json","build:node":"yarn build:node:10 && yarn build:node:12 && yarn build:node:14","build:node:10":"tsc -p ./tsconfig/node10.json","build:node:12":"tsc -p ./tsconfig/node12.json","build:node:14":"tsc -p ./tsconfig/node14.json","build:react-native":"tsc -p ./tsconfig/react-native.json","build:umd":"tsc -p ./tsconfig/umd.json","bump-deps":"yarn upgrade -LCA && yarn install && yarn test","clean":"./script/clean","polish":"prettier --write .","prepack":"echo 'Executing prepack' && yarn build:dists","serve:docs":"yarn build:docs && npx http-server ./docs","test":"jest --detectOpenHandles --forceExit ./*.test.js ./src/*.test.js","watch:compile":"tsc --watch --noEmit -p tsconfig.json","watch:test":"yarn test --watch"},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"yarn test && yarn build:esnext","prepare-commit-msg":"./script/has-message \"$1\" || ( exec < /dev/tty && git cz --hook )"}},"lint-staged":{"*.(js|cjs|mjs|json|yaml|yml|md|css|htm|htm|ts)":"prettier --write","*.json":"jq ."},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"sideEffects":false,"browserslist":["defaults, cover 95% and supports promises","not dead"],"gitHead":"104ca1dc6616da5c5d30b54e95ead0e667c98f71","bugs":{"url":"https://github.com/RobertFischer/fun-promises/issues"},"_id":"fun-promises@1.5.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-vFP8mo569JlRyrFMggI7t5SV2hqRzU6uo2+RN+sHllx7A5Wu/s/MhAvktykue8EBxbpuJlJ8lwwvmMhVW1wcKg==","shasum":"f143b98dd33c8165f8cdf113f63b4ce1a9e97260","tarball":"https://registry.npmjs.org/fun-promises/-/fun-promises-1.5.0.tgz","fileCount":112,"unpackedSize":1002663,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfy/41CRA9TVsSAnZWagAAR3oQAKSFJwABoUuOCp+JgC0M\nclmCKap4yhB/MnyOfjjkIRMwvVfzn7bbLEL0pRcyBwMYXBJ/Djs1l7bfpgnn\nAEu5ZEM3dHws/YcKHZwoHXpZjcSB1tV6QxyWMGR0/0/n0UOjqrchvQRiyHiH\nL7dIIFTyDe6UUhPkc0PjuYPOAJsNMDNyd30RdCDxJM2mUacUPQEdSPkTJmNu\nMLZ6dlTe48zYbvT/AE7Grvp4yBtaX1gaVerDMpM8YBOdwCLkCGZX7EiqUA9A\naDz7VCGcKbOw2jpS3ZsohXM351H61lKXlLYz7neRH7Zn6/E5unghFBuHcGZr\noOmAh0qTpzSzjBQxIMXQdZMfYTdXPFXqojoxGjE0Aji6AyY20X/C2G2LrBNE\nHqTS4sIyG7csdby0uWAP+TNocdVSbSFhIed8ZUW4y2h4siN3CvVrwFwzWt2/\nmbGbznfD3k/TqnCQIQgrYumg1GHTbivpk6TKO+qvDcwvf9dvGx5LctBLudKp\nP/zOnTGkRMUJO5aoMs3TZz82hBwZCJ+n3k9PTmh0F368HyGRUKO4HQ2yqI1m\nzCk9L6RcChxo44Dd9H1m3GTzJDFlQzx0FzkBXXVrYb2IGjENz6bHu9tc+ocW\nle8KT0aD5kLgDitaPlbuPfOPTGoE/4Co3dN9+3xZ53Y1wRxzVT+uP9HnUH1P\nm49J\r\n=qFFa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHr5DVA2MjZed/luQFnVPOUudH55p1FTY00z/YjbhLQ/AiAmQy2WR0Q90AXinRx18lo5QIMceebKoVyVvAuw6srnZw=="}]},"_npmUser":{"name":"robertfischer","email":"smokejumperit@gmail.com"},"directories":{},"maintainers":[{"name":"robertfischer","email":"smokejumperit@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fun-promises_1.5.0_1607204405206_0.24871652159662538"},"_hasShrinkwrap":false,"deprecated":"Deprecated in favor of 1.1.0-rc.2"},"1.6.0-rc.1":{"name":"fun-promises","version":"1.6.0-rc.1","description":"A library for making Promises more friendly, fluent, and fun(ctional).","main":"dist/node/v14/index.js","module":"dist/es6/esm/index.js","browser":"dist/browser/index.js","reactNative":"dist/react-native/index.js","source":"index.ts","repository":{"type":"git","url":"git+ssh://git@github.com/RobertFischer/fun-promises.git"},"author":{"name":"Robert Fischer"},"license":"Unlicense","private":false,"keywords":["async","asyncawait","await","bluebird","concurrency","concurrently","deferred","deferreds","flow control","functional programming","functional","future","futures","map","mapper","parallel","promise","promises","promises-a","promises-aplus","typescript"],"homepage":"https://robertfischer.github.io/fun-promises/","dependencies":{"@babel/runtime-corejs3":"^7.12.5","core-js":"^3.8.1","debug":"^4.3.1","lodash":"^4.17.20","ts-nested-error":"^1.2.1","tslib":"^2.0.3","typescript":"^4.1.2"},"devDependencies":{"@babel/cli":"^7.12.8","@babel/core":"^7.12.9","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-runtime":"^7.12.1","@babel/preset-env":"^7.12.7","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/github":"^7.2.0","@semantic-release/npm":"^7.0.9","@semantic-release/release-notes-generator":"^9.0.1","@tsconfig/node10":"^1.0.7","@tsconfig/node12":"^1.0.7","@tsconfig/node14":"^1.0.0","@tsconfig/react-native":"^1.0.2","@types/debug":"^4.1.5","@types/lodash":"^4.14.165","babel-minify":"^0.5.1","babel-plugin-import":"^1.13.3","babel-plugin-minify-dead-code-elimination":"^0.5.1","babel-plugin-minify-simplify":"^0.5.1","babel-plugin-remove-debug":"^0.0.4","conventional-changelog-conventionalcommits":"^4.5.0","cz-conventional-changelog":"^3.3.0","husky":"^4.3.4","jest":"^26.6.3","jest-extended":"^0.11.5","lint-staged":"^10.5.3","parcel":"^1.12.4","prettier":"^2.2.1","semantic-release":"^17.3.0","semantic-release-npm-deprecate-old-versions":"^1.0.1","ts-jest":"^26.4.4","typedoc":"^0.19.2","typedoc-plugin-nojekyll":"^1.0.1"},"scripts":{"build":"echo 'Executing build' && yarn build:dists && yarn build:docs","build:amd":"tsc -p ./tsconfig/amd.json","build:browser":"( test -d ./dist/esnext || yarn build:esnext ) && parcel build ./dist/esnext/index.js --target browser --out-dir ./dist/browser/ --global FunPromise --detailed-report 15","build:bundle":"./script/bootstrap && yarn build:dists && ./script/bundle-dists","build:cjs":"tsc -p ./tsconfig/cjs.json","build:dists":"rm -rf dist && yarn build:esnext && yarn build:es6 && yarn build:node && yarn build:react-native && yarn build:browser","build:docs":"rm -rf ./docs && yarn build:docs:typedocs && yarn build:docs:changelog && yarn build:docs:test && yarn build:docs:coverage && mkdir -p ./dist && tar cJvf ./dist/docs.tar.xz ./docs","build:docs:changelog":"cp ./CHANGELOG.md ./docs/ || true","build:docs:coverage":"mkdir -p ./docs && npx browserslist --update-db && (( echo 'Explicitly Supported Browsers (MUST support Promises)' && npx browserslist && npx browserslist --coverage && npx browserslist --coverage=US && echo 'Note that functionally equivalent but unlisted browsers do not count in these stats, so real coverage is much higher than the percentages reported.' ) | tee ./docs/coverage.txt)","build:docs:test":"yarn test --verbose 2>&1 | tee ./docs/test-results.txt","build:docs:typedocs":"typedoc --tsconfig tsconfig.json --gitRevision \"$(git rev-parse --short HEAD)\"","build:es6":"yarn build:cjs && yarn build:esm && yarn build:umd && yarn build:amd","build:esm":"tsc -p ./tsconfig/esm.json","build:esnext":"tsc -p tsconfig.json","build:node":"yarn build:node:10 && yarn build:node:12 && yarn build:node:14","build:node:10":"tsc -p ./tsconfig/node10.json","build:node:12":"tsc -p ./tsconfig/node12.json","build:node:14":"tsc -p ./tsconfig/node14.json","build:react-native":"tsc -p ./tsconfig/react-native.json","build:umd":"tsc -p ./tsconfig/umd.json","bump-deps":"yarn upgrade -LCA && yarn install && yarn test","clean":"./script/clean","polish":"prettier --write .","prepack":"echo 'Executing prepack' && yarn build:dists","serve:docs":"yarn build:docs && npx http-server ./docs","test":"jest --detectOpenHandles --forceExit ./*.test.js ./src/*.test.js","watch:compile":"tsc --watch --noEmit -p tsconfig.json","watch:test":"yarn test --watch"},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"yarn test && yarn build:esnext","prepare-commit-msg":"./script/has-message \"$1\" || ( exec < /dev/tty && git cz --hook )"}},"lint-staged":{"*.(js|cjs|mjs|json|yaml|yml|md|css|htm|htm|ts)":"prettier --write","*.json":"jq ."},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"sideEffects":false,"browserslist":["defaults, cover 95% and supports promises","not dead"],"readme":"<!-- @format -->\n\n# fun-promises\n\n**A library for making Promises more friendly, fluent, and fun(ctional).**\n\n## Install\n\n### Yarn\n\n```\nyarn add fun-promises\n```\n\n### npm\n\n```\nnpm install --save fun-promises\n```\n\n### CDN for Browsers\n\nThe following URL contains a script which will set the `FunPromise` global to be\nan object containing the various exports of\n[`index.ts`](https://robertfischer.github.io/fun-promises/modules/_index_.html).\n\n```\nhttps://unpkg.com/browse/fun-promises@latest/dist/browser/index.js\n```\n\n## Usage\n\n### ES Modules\n\n```\nimport FunPromise from \"fun-promises\";\n```\n\n### CJS\n\n```\nconst { FunPromise } = require(\"fun-promises\");\n```\n\n## What This Is Not\n\nThis is _not_ an implementation of [Promises/A+](https://promisesaplus.com/). It\nis not a polyfill or a [ponyfill](https://github.com/sindresorhus/ponyfill). In\nfact, it assumes that you have `Promise` available as a global, either through a\npolyfill or natively.\n\n## What This Is\n\nThis is a library that extends the native `Promise` implementation with a number\nof useful utilities, so that your code is faster and easier. It is inspired by\nlibraries like [`bluebird`](http://bluebirdjs.com/) and\n[`rsvp.js`](https://github.com/tildeio/rsvp.js/blob/master/README.md), except\nwithout the overhead of providing its own `Promise` implementation. Native\npromises have been competitive in performance since Node 10\n([even `bluebird` says so](https://www.npmjs.com/package/bluebird#note)) but\nthere's a lot of functionality which native `Promises` don't supply. Fun\nPromises gives you that better API without the overhead.\n\n## API\n\n- [FunPromise](http://robertfischer.github.io/fun-promises/classes/_src_fun_promise_.funpromise.html)\n- [Deferral](http://robertfischer.github.io/fun-promises/modules/_src_deferral_.deferral.html)\n- [Types](http://robertfischer.github.io/fun-promises/modules/_src_types_.html)\n\nYou also may want to check out\n[the BDD spec](http://robertfischer.github.io/fun-promises/test-results.txt),\nwhich gives an overview of how we expect these things to work.\n\n## Some Highlights\n\n### `Deferral` class\n\nThis is an inside-out promise: it gives you access to the `resolve` and `reject`\nmethods of the promise so that you can perform operations on them later, as well\nas having accessor to query the state of `promise`.\n\n### `try`\n\n```typescript\nFunPromise.try(() => doSomething(explosivelyFailingParamCalculation()));\nFunPromise.try(async () => {\n\t/* do stuff */ await something; /* do more stuff */\n});\n```\n\nWrap your execution in a promise, so that even its invocation\n[won't release Zalgo](https://blog.izs.me/2013/08/designing-apis-for-asynchrony),\nor as a convinent way to build a `FunPromise` off of an `async` function.\n\n### `tap`\n\n```typescript\nsomeExpensiveOperation()\n\t.tap((value) => debug(\"Value from someExpensiveOperation\", value))\n\t.then(/* ... */);\n```\n\nThis lets you take a look at a resolved value without risking changing it. This\nis extremely useful for debugging log messages.\n\n### `race`\n\n```typescript\ngetRelatedShows().race((someShow) => renderSuggestedShow(someShow));\n```\n\nFire off a bunch of promises and return whichever one resolves first. (The\nresults of any later-resolving promises are discarded.)\n\n### `coalesce`\n\n```typescript\nFunPromise.coalesce([\n\tlookupUserInMemoryCache,\n\tlookupUserInRedisCache,\n\tlookupUserInDB,\n]).then((data) => renderUserData(data));\n```\n\nGiven a bunch of functions that return either values or promises of values,\nexecute them sequentially and return the first one what resolves.\n\n### Types\n\nThere are types that represent unwrapped promise values\n([`Unpromise`](https://robertfischer.github.io/fun-promises/modules/_src_types_.html#unpromise)),\nthings that may be promises or values\n([`Promisable`](https://robertfischer.github.io/fun-promises/modules/_src_types_.html#promisable)),\nand\n[a few others that are a lot more esoteric](https://robertfischer.github.io/fun-promises/modules/_src_types_.html).\n\n_NOTE_: Compiling these types requires a recent version of TypeScript (4.1 or\ngreater) due to conditional recursive types being unavailable in 3.x and buggy\nin 4.0.x.\n\n## Distributions\n\nBy default, your packager should automatically grab the appropriate distribution\nthrough the `package.json` configuration within this library. If you're curious\nor if you have a weird use case, then each distribution has a few different\nflavors of the codebase to choose from. These all live under the `./dist`\ndirectory.\n\n### ESNext\n\nWithin `./dist/esnext` is the result of the Typescript compilation with the\n[\"ESNext\" `module` setting](https://www.typescriptlang.org/tsconfig#module) and\nthe [\"ESNext\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\nNote that it is subject to change as new ECMAScript standards are put out and\nTypescript's JavaScript generation continues to catch up to them, and mostly\nexists for developers to see code that results from compilation.\n\n### ES6\n\nWithin `./dist/es6` are the folders `amd`, `umd`, `cjs` (CommonJS), and `esm`\n(ECMAScript Modules). These contain the result of the Typescript compilation\nwith the corresponding\n[`module` setting](https://www.typescriptlang.org/tsconfig#module) and the\n[\"ES6\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\n\nThe only single-file distribution is the `es6/amd` distribution.\n\n### Node\n\nWithin `./dist/node` are the folders `v10`, `v12`, `v14`, each of which\ncontaining the Typescript compilation based on\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#node-10-tsconfigjson).\nfor those environments. All the versions are the exact same code as of this\nwriting, so we default Node to using `node/v14`.\n\n### Browser\n\nThe file at `./dist/browser/index.js` is the result of transpiling the result of\nthe `ESNext` code above using [Parcel](http://parceljs.org/). The result is a\nsingle minified file, appropriate for use in a CDN. It exposes the module under\nthe global `FunPromise` namespace.\n\n### React Native\n\nWithin `./dist/react-native` is the result of transpiling the result with\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#react-native-tsconfigjson)\nfor React Native. The distribution is specified in `package.json` under the\n`\"reactNative\"` key,\n[which you can configure Metro to prefer](https://facebook.github.io/metro/docs/configuration/#resolvermainfields).\n\n## Documentation\n\nThe full documentation (including this content) is available on\n[GitHub Pages](https://robertfischer.github.io/fun-promises/).\n\n### Specifications\n\nOur test specs are\n[published here](https://robertfischer.github.io/fun-promises/test-results.txt).\n","readmeFilename":"README.md","gitHead":"3ffd06c176b4ecd954afb743d31febb4231fff4e","bugs":{"url":"https://github.com/RobertFischer/fun-promises/issues"},"_id":"fun-promises@1.6.0-rc.1","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-zsOdswB/6rMSiwnXf6HG+2JvbQ26loUfgiSE2wX+/Br1KRPDR86bixPq1OLq8PvKG0gGM5XEYubuRQdOt7+mDQ==","shasum":"1039013c209f1d7affe7365e59aef63e2f9bf78b","tarball":"https://registry.npmjs.org/fun-promises/-/fun-promises-1.6.0-rc.1.tgz","fileCount":112,"unpackedSize":1028438,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfzWF9CRA9TVsSAnZWagAAsVwP/jXPmozDXXCxB8Pk+g3l\nCNthu1OwCrtfQSfkZ7QKRcTpBT4wGvDaPjk4OK+pPOBGqvcZzqtzbpYShcki\nuNY0nliLkqokawk/0WlHkuba0D4UuBlhC/WaKqPlnb12e+rPaTnVwxdpYZyO\nYO96qYGTO2BZ4sGx5z+pPaPRE9nB3py2IOtGajmXsm1boUwPSdm0yOk9Oq/r\nS2zG+l4VG5ZWH+aKvzRE8tgSfuiqcsm+rrTO5wwrDTxJ9ov0+rJFnZDOuYgZ\nLdnm+WErDYb2TFrrLxoWuUTqxINiAxu9eLZuHX66hwFSU/+5t22xNAQfT5QP\n+CPPH/6m0c4p3zhQeVmfDAiQNDYrkNYU81ZXuXjUe1cOPoBzZ12VDbiWzDYK\niqzu2gvL9Z3fMWE+ukeE8joO8T+GFNBxAdAG1Iw9AX1RfDCoSEts4QBvuHTi\nfGzZ+fCNM8UkOt+jtLsQD8PhKmVR+Y4VqYc9mBOPmlAqN+Q946W2DBNtCQBl\nX9VkfWFGX84j2EigFte5zOnQQ/y8gZ7CtZAPqPsSehQdhkplgLVAon6hPyCk\nOvOA3T5LCWqdDOe2PNw/j5Ai+DxbC5MditVELJOZkJhpfL9p8g4VkgqU57Jp\n+3or9vJiF3bwe6vzcnvnjDHPZHQbdpdtHJRFcd/UZq7F4dXQFe1s1nlr+pZO\ns5hB\r\n=dsoS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4US+FZn0C/zLMi6ZcM8aBFdOMkl9vrqT3QLg2WOmR2wIgR7/oWGMGy6SDQWnPvFJeqWBxKGS+G5yCa/A+Dump8o4="}]},"_npmUser":{"name":"robertfischer","email":"smokejumperit@gmail.com"},"directories":{},"maintainers":[{"name":"robertfischer","email":"smokejumperit@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fun-promises_1.6.0-rc.1_1607295356460_0.6755421778429145"},"_hasShrinkwrap":false,"deprecated":"Deprecated in favor of 1.1.0-rc.2"},"1.6.0":{"name":"fun-promises","version":"1.6.0","description":"A library for making Promises more friendly, fluent, and fun(ctional).","main":"dist/node/v14/index.js","module":"dist/es6/esm/index.js","browser":"dist/browser/index.js","reactNative":"dist/react-native/index.js","source":"index.ts","repository":{"type":"git","url":"git+ssh://git@github.com/RobertFischer/fun-promises.git"},"author":{"name":"Robert Fischer"},"license":"Unlicense","private":false,"keywords":["async","asyncawait","await","bluebird","concurrency","concurrently","deferred","deferreds","flow control","functional programming","functional","future","futures","map","mapper","parallel","promise","promises","promises-a","promises-aplus","typescript"],"homepage":"https://robertfischer.github.io/fun-promises/","dependencies":{"@babel/runtime-corejs3":"^7.12.5","core-js":"^3.8.1","debug":"^4.3.1","lodash":"^4.17.20","ts-nested-error":"^1.2.1","tslib":"^2.0.3","typescript":"^4.1.2"},"devDependencies":{"@babel/cli":"^7.12.8","@babel/core":"^7.12.9","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-runtime":"^7.12.1","@babel/preset-env":"^7.12.7","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/github":"^7.2.0","@semantic-release/npm":"^7.0.9","@semantic-release/release-notes-generator":"^9.0.1","@tsconfig/node10":"^1.0.7","@tsconfig/node12":"^1.0.7","@tsconfig/node14":"^1.0.0","@tsconfig/react-native":"^1.0.2","@types/debug":"^4.1.5","@types/lodash":"^4.14.165","babel-minify":"^0.5.1","babel-plugin-import":"^1.13.3","babel-plugin-minify-dead-code-elimination":"^0.5.1","babel-plugin-minify-simplify":"^0.5.1","babel-plugin-remove-debug":"^0.0.4","conventional-changelog-conventionalcommits":"^4.5.0","cz-conventional-changelog":"^3.3.0","husky":"^4.3.4","jest":"^26.6.3","jest-extended":"^0.11.5","lint-staged":"^10.5.3","parcel":"^1.12.4","prettier":"^2.2.1","semantic-release":"^17.3.0","semantic-release-npm-deprecate-old-versions":"^1.0.1","ts-jest":"^26.4.4","typedoc":"^0.19.2","typedoc-plugin-nojekyll":"^1.0.1"},"scripts":{"build":"echo 'Executing build' && yarn build:dists && yarn build:docs","build:amd":"tsc -p ./tsconfig/amd.json","build:browser":"( test -d ./dist/esnext || yarn build:esnext ) && parcel build ./dist/esnext/index.js --target browser --out-dir ./dist/browser/ --global FunPromise --detailed-report 15","build:bundle":"./script/bootstrap && yarn build:dists && ./script/bundle-dists","build:cjs":"tsc -p ./tsconfig/cjs.json","build:dists":"rm -rf dist && yarn build:esnext && yarn build:es6 && yarn build:node && yarn build:react-native && yarn build:browser","build:docs":"rm -rf ./docs && yarn build:docs:typedocs && yarn build:docs:changelog && yarn build:docs:test && yarn build:docs:coverage && mkdir -p ./dist && tar cJvf ./dist/docs.tar.xz ./docs","build:docs:changelog":"cp ./CHANGELOG.md ./docs/ || true","build:docs:coverage":"mkdir -p ./docs && npx browserslist --update-db && (( echo 'Explicitly Supported Browsers (MUST support Promises)' && npx browserslist && npx browserslist --coverage && npx browserslist --coverage=US && echo 'Note that functionally equivalent but unlisted browsers do not count in these stats, so real coverage is much higher than the percentages reported.' ) | tee ./docs/coverage.txt)","build:docs:test":"yarn test --verbose 2>&1 | tee ./docs/test-results.txt","build:docs:typedocs":"typedoc --tsconfig tsconfig.json --gitRevision \"$(git rev-parse --short HEAD)\"","build:es6":"yarn build:cjs && yarn build:esm && yarn build:umd && yarn build:amd","build:esm":"tsc -p ./tsconfig/esm.json","build:esnext":"tsc -p tsconfig.json","build:node":"yarn build:node:10 && yarn build:node:12 && yarn build:node:14","build:node:10":"tsc -p ./tsconfig/node10.json","build:node:12":"tsc -p ./tsconfig/node12.json","build:node:14":"tsc -p ./tsconfig/node14.json","build:react-native":"tsc -p ./tsconfig/react-native.json","build:umd":"tsc -p ./tsconfig/umd.json","bump-deps":"yarn upgrade -LCA && yarn install && yarn test","clean":"./script/clean","polish":"prettier --write .","prepack":"echo 'Executing prepack' && yarn build:dists","serve:docs":"yarn build:docs && npx http-server ./docs","test":"jest --detectOpenHandles --forceExit ./*.test.js ./src/*.test.js","watch:compile":"tsc --watch --noEmit -p tsconfig.json","watch:test":"yarn test --watch"},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"yarn test && yarn build:esnext","prepare-commit-msg":"./script/has-message \"$1\" || ( exec < /dev/tty && git cz --hook )"}},"lint-staged":{"*.(js|cjs|mjs|json|yaml|yml|md|css|htm|htm|ts)":"prettier --write","*.json":"jq ."},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"sideEffects":false,"browserslist":["defaults, cover 95% and supports promises","not dead"],"gitHead":"05f590b8bad74f51ee32c9c767fbfe83f57a147e","bugs":{"url":"https://github.com/RobertFischer/fun-promises/issues"},"_id":"fun-promises@1.6.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-9KHGs6crgBiZOIC0bxZGEWkeqQVq1UNB03l+RexbUEILqkU4MzmEda/Aw+QnDgYImdQgdNWOn4wcDNi9Xwk8MA==","shasum":"ebb00baee02f757db96258a5fbe4e61489fd9720","tarball":"https://registry.npmjs.org/fun-promises/-/fun-promises-1.6.0.tgz","fileCount":112,"unpackedSize":957734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz5uyCRA9TVsSAnZWagAAQB4P/372NaNDuy7euawLrfcQ\niaQ+FV6lejyp5X8GyXJ7mM+h7Jnjj1QyiISu/QeaTHiXEjssZ3fNF/3D+omi\n+XLHwqmEllLO4D2uWG4zmf/EKQqCOYcZcf2rmin4qHpd8dJfv4eHJJGJi0QC\n8cK4TvEU160DNV7yPSaLiqc1GHGuO1+3kFy+LImocrhWK8JT+CpCWgriMEjp\n2PkUIF+jmhlMi3CtS+oD7RfMAMPN17r50b3PbkEp+s0cXxDHizI76/bAyPdr\nZfNCXA/CX09+30Vtboxc+eFakgeP9jIShHmg/KaKKTFGCMIqgq0Ob6s3PgpO\n7V3v3io+RhzkA4xIvj3fcSRlYiZ+VKF1flvtc1ZMHZ0RJAWMkVIHUMrHuZfq\n1aCRIy8cN/StpyOtjdUJgsMPSCGXRA8t/zn5LFbs9VW7Uu6NTdMHRtVK+b7M\nEHxjb5yEebucWH4W9jDVY92yWWjMxYYLlCR/LQ90tMGfuEeg9tEPWhigiJOQ\npFQ4mL0MWvATqp2Fi+ayobWg8stQ4orEhAGKfiTgrSP3UhgSI+dMtMgu8pgE\n8GZQCXFx9Wjbv35WCQ9C5X8IRFVogfqZmqFpH/o0hqSodG+8aK+66ZK65ubD\nlP7yITWiP7f8WMcu1vLkUvn4WWWrsNRNtLePeCe42PAdSTknD7xJSgmuCeRn\nMKDN\r\n=DmXa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFbkLGRNdu7dvfnVmalTDmvoOVRr3XGEFITMmY3fECqgIgZk/K6W/k6olTZRhgdDGwpNz5rbJBzwobwkJHIejo0qA="}]},"_npmUser":{"name":"robertfischer","email":"smokejumperit@gmail.com"},"directories":{},"maintainers":[{"name":"robertfischer","email":"smokejumperit@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fun-promises_1.6.0_1607441329887_0.48889145065461803"},"_hasShrinkwrap":false,"deprecated":"Deprecated in favor of 1.1.0-rc.2"},"2.0.0-rc.1":{"name":"fun-promises","version":"2.0.0-rc.1","description":"A library for making Promises more friendly, fluent, and fun(ctional).","main":"dist/node/v14/index.js","module":"dist/es6/esm/index.js","browser":"dist/browser/index.js","reactNative":"dist/react-native/index.js","source":"index.ts","repository":{"type":"git","url":"git+ssh://git@github.com/RobertFischer/fun-promises.git"},"author":{"name":"Robert Fischer"},"license":"Unlicense","private":false,"keywords":["async","asyncawait","await","bluebird","concurrency","concurrently","deferred","deferreds","flow control","functional programming","functional","future","futures","map","mapper","parallel","promise","promises","promises-a","promises-aplus","typescript"],"homepage":"https://robertfischer.github.io/fun-promises/","dependencies":{"@babel/runtime-corejs3":"^7.12.5","core-js":"^3.8.1","debug":"^4.3.1","lodash":"^4.17.20","ts-nested-error":"^1.2.1","tslib":"^2.0.3","typescript":"^4.1.2"},"devDependencies":{"@babel/cli":"^7.12.8","@babel/core":"^7.12.9","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-runtime":"^7.12.1","@babel/preset-env":"^7.12.7","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/github":"^7.2.0","@semantic-release/npm":"^7.0.9","@semantic-release/release-notes-generator":"^9.0.1","@tsconfig/node10":"^1.0.7","@tsconfig/node12":"^1.0.7","@tsconfig/node14":"^1.0.0","@tsconfig/react-native":"^1.0.2","@types/debug":"^4.1.5","@types/lodash":"^4.14.165","babel-minify":"^0.5.1","babel-plugin-import":"^1.13.3","babel-plugin-minify-dead-code-elimination":"^0.5.1","babel-plugin-minify-simplify":"^0.5.1","babel-plugin-remove-debug":"^0.0.4","conventional-changelog-conventionalcommits":"^4.5.0","cz-conventional-changelog":"^3.3.0","husky":"^4.3.5","jest":"^26.6.3","jest-extended":"^0.11.5","lint-staged":"^10.5.3","parcel":"^1.12.4","prettier":"^2.2.1","semantic-release":"^17.3.0","semantic-release-npm-deprecate-old-versions":"^1.0.1","ts-jest":"^26.4.4","typedoc":"^0.19.2","typedoc-plugin-nojekyll":"^1.0.1"},"scripts":{"build":"echo 'Executing build' && yarn build:dists && yarn build:docs","build:amd":"tsc -p ./tsconfig/amd.json","build:browser":"( test -d ./dist/esnext || yarn build:esnext ) && parcel build ./dist/esnext/index.js --target browser --out-dir ./dist/browser/ --global FunPromise --detailed-report 15","build:bundle":"./script/bootstrap && yarn build:dists && ./script/bundle-dists","build:cjs":"tsc -p ./tsconfig/cjs.json","build:dists":"rm -rf dist && yarn build:esnext && yarn build:es6 && yarn build:node && yarn build:react-native && yarn build:browser","build:docs":"rm -rf ./docs && yarn build:docs:typedocs && yarn build:docs:changelog && yarn build:docs:test && yarn build:docs:coverage && mkdir -p ./dist && tar cJvf ./dist/docs.tar.xz ./docs","build:docs:changelog":"cp ./CHANGELOG.md ./docs/ || true","build:docs:coverage":"mkdir -p ./docs && npx browserslist --update-db && (( echo 'Explicitly Supported Browsers (MUST support Promises)' && npx browserslist && npx browserslist --coverage && npx browserslist --coverage=US && echo 'Note that functionally equivalent but unlisted browsers do not count in these stats, so real coverage is much higher than the percentages reported.' ) | tee ./docs/coverage.txt)","build:docs:test":"yarn test --verbose 2>&1 | tee ./docs/test-results.txt","build:docs:typedocs":"typedoc --tsconfig tsconfig.json --gitRevision \"$(git rev-parse --short HEAD)\"","build:es6":"yarn build:cjs && yarn build:esm && yarn build:umd && yarn build:amd","build:esm":"tsc -p ./tsconfig/esm.json","build:esnext":"tsc -p tsconfig.json","build:node":"yarn build:node:10 && yarn build:node:12 && yarn build:node:14","build:node:10":"tsc -p ./tsconfig/node10.json","build:node:12":"tsc -p ./tsconfig/node12.json","build:node:14":"tsc -p ./tsconfig/node14.json","build:react-native":"tsc -p ./tsconfig/react-native.json","build:umd":"tsc -p ./tsconfig/umd.json","bump-deps":"yarn upgrade -LCA && yarn install && yarn test","clean":"./script/clean","polish":"prettier --write .","prepack":"echo 'Executing prepack' && yarn build:dists","serve:docs":"yarn build:docs && npx http-server ./docs","test":"jest --detectOpenHandles --forceExit ./*.test.js ./src/*.test.js","watch:compile":"tsc --watch -p tsconfig.json","watch:test":"yarn test --watch"},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"yarn test && yarn build:esnext","prepare-commit-msg":"./script/has-message \"$1\" || ( exec < /dev/tty && git cz --hook )"}},"lint-staged":{"*.(js|cjs|mjs|json|yaml|yml|md|css|htm|htm|ts)":"prettier --write","*.json":"jq ."},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"sideEffects":false,"browserslist":["defaults, cover 95% and supports promises","not dead"],"readme":"<!-- @format -->\n\n# fun-promises\n\n**A library for making Promises more friendly, fluent, and fun(ctional).**\n\n## Install\n\n### Yarn\n\n```\nyarn add fun-promises\n```\n\n### npm\n\n```\nnpm install --save fun-promises\n```\n\n### CDN for Browsers\n\nThe following URL contains a script which will set the `FunPromise` global to be\nan object containing the various exports of\n[`index.ts`](https://robertfischer.github.io/fun-promises/modules/_index_.html).\n\n```\nhttps://unpkg.com/browse/fun-promises@latest/dist/browser/index.js\n```\n\n## Usage\n\n### ES Modules\n\n```\nimport FunPromise from \"fun-promises\";\n```\n\n### CJS\n\n```\nconst { FunPromise } = require(\"fun-promises\");\n```\n\n## What This Is Not\n\nThis is _not_ an implementation of [Promises/A+](https://promisesaplus.com/). It\nis not a polyfill or a [ponyfill](https://github.com/sindresorhus/ponyfill). In\nfact, it assumes that you have `Promise` available as a global, either through a\npolyfill or natively.\n\n## What This Is\n\nThis is a library that extends the native `Promise` implementation with a number\nof useful utilities, so that your code is faster and easier. It is inspired by\nlibraries like [`bluebird`](http://bluebirdjs.com/) and\n[`rsvp.js`](https://github.com/tildeio/rsvp.js/blob/master/README.md), except\nwithout the overhead of providing its own `Promise` implementation. Native\npromises have been competitive in performance since Node 10\n([even `bluebird` says so](https://www.npmjs.com/package/bluebird#note)) but\nthere's a lot of functionality which native `Promises` don't supply. Fun\nPromises gives you that better API without the overhead.\n\n## API\n\n- [FunPromise](http://robertfischer.github.io/fun-promises/classes/_src_fun_promise_.funpromise.html)\n- [Deferral](http://robertfischer.github.io/fun-promises/modules/_src_deferral_.deferral.html)\n- [Types](http://robertfischer.github.io/fun-promises/modules/_src_types_.html)\n\nYou also may want to check out\n[the BDD spec](http://robertfischer.github.io/fun-promises/test-results.txt),\nwhich gives an overview of how we expect these things to work.\n\n## Some Highlights\n\n### `Deferral` class\n\nThis is an inside-out promise: it gives you access to the `resolve` and `reject`\nmethods of the promise so that you can perform operations on them later, as well\nas having accessor to query the state of `promise`.\n\n### `try`\n\n```typescript\nFunPromise.try(() => doSomething(explosivelyFailingParamCalculation()));\nFunPromise.try(async () => {\n\t/* do stuff */ await something; /* do more stuff */\n});\n```\n\nWrap your execution in a promise, so that even its invocation\n[won't release Zalgo](https://blog.izs.me/2013/08/designing-apis-for-asynchrony),\nor as a convinent way to build a `FunPromise` off of an `async` function.\n\n### `tap`\n\n```typescript\nsomeExpensiveOperation()\n\t.tap((value) => debug(\"Value from someExpensiveOperation\", value))\n\t.then(/* ... */);\n```\n\nThis lets you take a look at a resolved value without risking changing it. This\nis extremely useful for debugging log messages.\n\n### `race`\n\n```typescript\ngetRelatedShows().race((someShow) => renderSuggestedShow(someShow));\n```\n\nFire off a bunch of promises and return whichever one resolves first. (The\nresults of any later-resolving promises are discarded.)\n\n### `coalesce`\n\n```typescript\nFunPromise.coalesce([\n\tlookupUserInMemoryCache,\n\tlookupUserInRedisCache,\n\tlookupUserInDB,\n]).then((data) => renderUserData(data));\n```\n\nGiven a bunch of functions that return either values or promises of values,\nexecute them sequentially and return the first one what resolves.\n\n### Types\n\nThere are types that represent unwrapped promise values\n([`Unpromise`](https://robertfischer.github.io/fun-promises/modules/_src_types_.html#unpromise)),\nthings that may be promises or values\n([`Promisable`](https://robertfischer.github.io/fun-promises/modules/_src_types_.html#promisable)),\nand\n[a few others that are a lot more esoteric](https://robertfischer.github.io/fun-promises/modules/_src_types_.html).\n\n_NOTE_: Compiling these types requires a recent version of TypeScript (4.1 or\ngreater) due to conditional recursive types being unavailable in 3.x and buggy\nin 4.0.x.\n\n## Distributions\n\nBy default, your packager should automatically grab the appropriate distribution\nthrough the `package.json` configuration within this library. If you're curious\nor if you have a weird use case, then each distribution has a few different\nflavors of the codebase to choose from. These all live under the `./dist`\ndirectory.\n\n### ESNext\n\nWithin `./dist/esnext` is the result of the Typescript compilation with the\n[\"ESNext\" `module` setting](https://www.typescriptlang.org/tsconfig#module) and\nthe [\"ESNext\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\nNote that it is subject to change as new ECMAScript standards are put out and\nTypescript's JavaScript generation continues to catch up to them, and mostly\nexists for developers to see code that results from compilation.\n\n### ES6\n\nWithin `./dist/es6` are the folders `amd`, `umd`, `cjs` (CommonJS), and `esm`\n(ECMAScript Modules). These contain the result of the Typescript compilation\nwith the corresponding\n[`module` setting](https://www.typescriptlang.org/tsconfig#module) and the\n[\"ES6\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\n\nThe only single-file distribution is the `es6/amd` distribution.\n\n### Node\n\nWithin `./dist/node` are the folders `v10`, `v12`, `v14`, each of which\ncontaining the Typescript compilation based on\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#node-10-tsconfigjson).\nfor those environments. All the versions are the exact same code as of this\nwriting, so we default Node to using `node/v14`.\n\n### Browser\n\nThe file at `./dist/browser/index.js` is the result of transpiling the result of\nthe `ESNext` code above using [Parcel](http://parceljs.org/). The result is a\nsingle minified file, appropriate for use in a CDN. It exposes the module under\nthe global `FunPromise` namespace.\n\n### React Native\n\nWithin `./dist/react-native` is the result of transpiling the result with\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#react-native-tsconfigjson)\nfor React Native. The distribution is specified in `package.json` under the\n`\"reactNative\"` key,\n[which you can configure Metro to prefer](https://facebook.github.io/metro/docs/configuration/#resolvermainfields).\n\n## Documentation\n\nThe full documentation (including this content) is available on\n[GitHub Pages](https://robertfischer.github.io/fun-promises/).\n\n### Specifications\n\nOur test specs are\n[published here](https://robertfischer.github.io/fun-promises/test-results.txt).\n","readmeFilename":"README.md","gitHead":"7d8efe7036e39fe5de635e0474c8f864a07fbaa8","bugs":{"url":"https://github.com/RobertFischer/fun-promises/issues"},"_id":"fun-promises@2.0.0-rc.1","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-hwvza5pspCJH/g+c7UEEfrgpc8bsZENdvegHPdP3Ie0cnn1RuJboA4/5lcGqQvIeZW/oQCGeG786FazHPEHUkQ==","shasum":"ea015d9213bc44418a898aeee4b817fb788056a7","tarball":"https://registry.npmjs.org/fun-promises/-/fun-promises-2.0.0-rc.1.tgz","fileCount":112,"unpackedSize":965273,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0QAPCRA9TVsSAnZWagAA080P+QCNHqJjGSwwV9IXppre\nuCzYyETKPGJaNamd3ZDF5xgW4X+aa/DI8i8VimW2nfCTmU/qTJ7TsmEqfOYi\n4MSsLR+spnuEPPrVwHF+ajArfB3Si20UwHfU+cG9WK797CSWgmpEtwlz2kZ3\nawvA+SjLK6wLLrgWTf1O30clBTpIfb9c97RaodBbxLaFHAuLLvPfBWi19IHN\neBk4MkrPcB+Yz1GS8L2UT+h/OYfWpoxr4rL53nnSnhpFUFTyG+VTcsynzlEm\nOEJS8C5FunVb5+bSRXBBGYu3jFeL0ktogchQcYCuG/xUo8xUUy/y6tK00R2T\n0+XhWTNcx4+tvpCzvEtdWzSiW7q1iDopjKV9KmtK5pNMbZAgdxA50/HcofLS\nQNiAtIHu1MGsZaw+j+MG5tFUEs6uXtO91j1gw+A3RciTIvujRTz9TOAXFZhC\n+vtNdEidb/T/cj2xgEDlxNC6hq8rbvBJogF9UMv6/tqXXDjcfpeX+LaFBif+\nhJSTLbO2w5EXPNma9BY5wegefjJiQTh7naM2W223LOSNU3sfURZAAT1do9Z0\nQ9mz53lwMByAY7xdeadCkoD9HZCsxbUK68AWgtLwgp2WpHzvacf2CkGR9njA\nJz2qIZCquc2SlIEe5bT+5nlqvVaWdRt0Vb8zNLZbv0wTV+WCT8hjv20oHFJ/\nlmhG\r\n=XR16\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCoM3y+0XMnnRrIsunZ4K8US3+NUmIU9b5nFIICRVq5/wIgc0tmFbCHZ66gGyOo4F0CHFA56O+xoMgKvLhPo+rGebc="}]},"_npmUser":{"name":"robertfischer","email":"smokejumperit@gmail.com"},"directories":{},"maintainers":[{"name":"robertfischer","email":"smokejumperit@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fun-promises_2.0.0-rc.1_1607532558364_0.5013146932208092"},"_hasShrinkwrap":false,"deprecated":"Deprecated in favor of 2.0.1-rc.3"},"2.0.0-rc.2":{"name":"fun-promises","version":"2.0.0-rc.2","description":"A library for making Promises more friendly, fluent, and fun(ctional).","main":"dist/node/v14/index.js","module":"dist/es6/esm/index.js","browser":"dist/browser/index.js","reactNative":"dist/react-native/index.js","source":"index.ts","repository":{"type":"git","url":"git+ssh://git@github.com/RobertFischer/fun-promises.git"},"author":{"name":"Robert Fischer"},"license":"Unlicense","private":false,"keywords":["async","asyncawait","await","bluebird","concurrency","concurrently","deferred","deferreds","flow control","functional programming","functional","future","futures","map","mapper","parallel","promise","promises","promises-a","promises-aplus","typescript"],"homepage":"https://robertfischer.github.io/fun-promises/","dependencies":{"@babel/runtime-corejs3":"^7.12.5","core-js":"^3.8.1","debug":"^4.3.1","lodash":"^4.17.20","ts-nested-error":"^1.2.1","tslib":"^2.0.3","typescript":"^4.1.2"},"devDependencies":{"@babel/cli":"^7.12.8","@babel/core":"^7.12.9","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-runtime":"^7.12.1","@babel/preset-env":"^7.12.7","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/github":"^7.2.0","@semantic-release/npm":"^7.0.9","@semantic-release/release-notes-generator":"^9.0.1","@tsconfig/node10":"^1.0.7","@tsconfig/node12":"^1.0.7","@tsconfig/node14":"^1.0.0","@tsconfig/react-native":"^1.0.2","@types/debug":"^4.1.5","@types/lodash":"^4.14.165","babel-minify":"^0.5.1","babel-plugin-import":"^1.13.3","babel-plugin-minify-dead-code-elimination":"^0.5.1","babel-plugin-minify-simplify":"^0.5.1","babel-plugin-remove-debug":"^0.0.4","conventional-changelog-conventionalcommits":"^4.5.0","cz-conventional-changelog":"^3.3.0","husky":"^4.3.5","jest":"^26.6.3","jest-extended":"^0.11.5","lint-staged":"^10.5.3","parcel":"^1.12.4","prettier":"^2.2.1","semantic-release":"^17.3.0","semantic-release-npm-deprecate-old-versions":"^1.0.1","ts-jest":"^26.4.4","typedoc":"^0.19.2","typedoc-plugin-nojekyll":"^1.0.1"},"scripts":{"build":"echo 'Executing build' && yarn build:dists && yarn build:docs","build:amd":"tsc -p ./tsconfig/amd.json","build:browser":"( test -d ./dist/esnext || yarn build:esnext ) && parcel build ./dist/esnext/index.js --target browser --out-dir ./dist/browser/ --global FunPromise --detailed-report 15","build:bundle":"./script/bootstrap && yarn build:dists && ./script/bundle-dists","build:cjs":"tsc -p ./tsconfig/cjs.json","build:dists":"rm -rf dist && yarn build:esnext && yarn build:es6 && yarn build:node && yarn build:react-native && yarn build:browser","build:docs":"rm -rf ./docs && yarn build:docs:typedocs && yarn build:docs:changelog && yarn build:docs:test && yarn build:docs:coverage && mkdir -p ./dist && tar cJvf ./dist/docs.tar.xz ./docs","build:docs:changelog":"cp ./CHANGELOG.md ./docs/ || true","build:docs:coverage":"mkdir -p ./docs && npx browserslist --update-db && (( echo 'Explicitly Supported Browsers (MUST support Promises)' && npx browserslist && npx browserslist --coverage && npx browserslist --coverage=US && echo 'Note that functionally equivalent but unlisted browsers do not count in these stats, so real coverage is much higher than the percentages reported.' ) | tee ./docs/coverage.txt)","build:docs:test":"yarn test --verbose 2>&1 | tee ./docs/test-results.txt","build:docs:typedocs":"typedoc --tsconfig tsconfig.json --gitRevision \"$(git rev-parse --short HEAD)\"","build:es6":"yarn build:cjs && yarn build:esm && yarn build:umd && yarn build:amd","build:esm":"tsc -p ./tsconfig/esm.json","build:esnext":"tsc -p tsconfig.json","build:node":"yarn build:node:10 && yarn build:node:12 && yarn build:node:14","build:node:10":"tsc -p ./tsconfig/node10.json","build:node:12":"tsc -p ./tsconfig/node12.json","build:node:14":"tsc -p ./tsconfig/node14.json","build:react-native":"tsc -p ./tsconfig/react-native.json","build:umd":"tsc -p ./tsconfig/umd.json","bump-deps":"yarn upgrade -LCA && yarn install && yarn test","clean":"./script/clean","polish":"prettier --write .","prepack":"echo 'Executing prepack' && yarn build:dists","serve:docs":"yarn build:docs && npx http-server ./docs","test":"jest --detectOpenHandles --forceExit ./*.test.js ./src/*.test.js","watch:compile":"tsc --watch -p tsconfig.json","watch:test":"yarn test --watch"},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"yarn test && yarn build:esnext","prepare-commit-msg":"./script/has-message \"$1\" || ( exec < /dev/tty && git cz --hook )"}},"lint-staged":{"*.(js|cjs|mjs|json|yaml|yml|md|css|htm|htm|ts)":"prettier --write","*.json":"jq ."},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"sideEffects":false,"browserslist":["defaults, cover 95% and supports promises","not dead"],"readme":"<!-- @format -->\n\n# fun-promises\n\n**A library for making Promises more friendly, fluent, and fun(ctional).**\n\n## Install\n\n### Yarn\n\n```\nyarn add fun-promises\n```\n\n### npm\n\n```\nnpm install --save fun-promises\n```\n\n### CDN for Browsers\n\nThe following URL contains a script which will set the `FunPromise` global to be\nan object containing the various exports of\n[`index.ts`](https://robertfischer.github.io/fun-promises/modules/_index_.html).\n\n```\nhttps://unpkg.com/browse/fun-promises@latest/dist/browser/index.js\n```\n\n## Usage\n\n### ES Modules\n\n```\nimport FunPromise from \"fun-promises\";\n```\n\n### CJS\n\n```\nconst { FunPromise } = require(\"fun-promises\");\n```\n\n## What This Is Not\n\nThis is _not_ an implementation of [Promises/A+](https://promisesaplus.com/). It\nis not a polyfill or a [ponyfill](https://github.com/sindresorhus/ponyfill). In\nfact, it assumes that you have `Promise` available as a global, either through a\npolyfill or natively.\n\n## What This Is\n\nThis is a library that extends the native `Promise` implementation with a number\nof useful utilities, so that your code is faster and easier. It is inspired by\nlibraries like [`bluebird`](http://bluebirdjs.com/) and\n[`rsvp.js`](https://github.com/tildeio/rsvp.js/blob/master/README.md), except\nwithout the overhead of providing its own `Promise` implementation. Native\npromises have been competitive in performance since Node 10\n([even `bluebird` says so](https://www.npmjs.com/package/bluebird#note)) but\nthere's a lot of functionality which native `Promises` don't supply. Fun\nPromises gives you that better API without the overhead.\n\n## API\n\n- [FunPromise](http://robertfischer.github.io/fun-promises/classes/_src_fun_promise_.funpromise.html)\n- [Deferral](http://robertfischer.github.io/fun-promises/modules/_src_deferral_.deferral.html)\n- [Types](http://robertfischer.github.io/fun-promises/modules/_src_types_.html)\n\nYou also may want to check out\n[the BDD spec](http://robertfischer.github.io/fun-promises/test-results.txt),\nwhich gives an overview of how we expect these things to work.\n\n## Some Highlights\n\n### `Deferral` class\n\nThis is an inside-out promise: it gives you access to the `resolve` and `reject`\nmethods of the promise so that you can perform operations on them later, as well\nas having accessor to query the state of `promise`.\n\n### `try`\n\n```typescript\nFunPromise.try(() => doSomething(explosivelyFailingParamCalculation()));\nFunPromise.try(async () => {\n\t/* do stuff */ await something; /* do more stuff */\n});\n```\n\nWrap your execution in a promise, so that even its invocation\n[won't release Zalgo](https://blog.izs.me/2013/08/designing-apis-for-asynchrony),\nor as a convinent way to build a `FunPromise` off of an `async` function.\n\n### `tap`\n\n```typescript\nsomeExpensiveOperation()\n\t.tap((value) => debug(\"Value from someExpensiveOperation\", value))\n\t.then(/* ... */);\n```\n\nThis lets you take a look at a resolved value without risking changing it. This\nis extremely useful for debugging log messages.\n\n### `race`\n\n```typescript\ngetRelatedShows().race((someShow) => renderSuggestedShow(someShow));\n```\n\nFire off a bunch of promises and return whichever one resolves first. (The\nresults of any later-resolving promises are discarded.)\n\n### `coalesce`\n\n```typescript\nFunPromise.coalesce([\n\tlookupUserInMemoryCache,\n\tlookupUserInRedisCache,\n\tlookupUserInDB,\n]).then((data) => renderUserData(data));\n```\n\nGiven a bunch of functions that return either values or promises of values,\nexecute them sequentially and return the first one what resolves.\n\n### Types\n\nThere are types that represent unwrapped promise values\n([`Unpromise`](https://robertfischer.github.io/fun-promises/modules/_src_types_.html#unpromise)),\nthings that may be promises or values\n([`Promisable`](https://robertfischer.github.io/fun-promises/modules/_src_types_.html#promisable)),\nand\n[a few others that are a lot more esoteric](https://robertfischer.github.io/fun-promises/modules/_src_types_.html).\n\n_NOTE_: Compiling these types requires a recent version of TypeScript (4.1 or\ngreater) due to conditional recursive types being unavailable in 3.x and buggy\nin 4.0.x.\n\n## Distributions\n\nBy default, your packager should automatically grab the appropriate distribution\nthrough the `package.json` configuration within this library. If you're curious\nor if you have a weird use case, then each distribution has a few different\nflavors of the codebase to choose from. These all live under the `./dist`\ndirectory.\n\n### ESNext\n\nWithin `./dist/esnext` is the result of the Typescript compilation with the\n[\"ESNext\" `module` setting](https://www.typescriptlang.org/tsconfig#module) and\nthe [\"ESNext\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\nNote that it is subject to change as new ECMAScript standards are put out and\nTypescript's JavaScript generation continues to catch up to them, and mostly\nexists for developers to see code that results from compilation.\n\n### ES6\n\nWithin `./dist/es6` are the folders `amd`, `umd`, `cjs` (CommonJS), and `esm`\n(ECMAScript Modules). These contain the result of the Typescript compilation\nwith the corresponding\n[`module` setting](https://www.typescriptlang.org/tsconfig#module) and the\n[\"ES6\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\n\nThe only single-file distribution is the `es6/amd` distribution.\n\n### Node\n\nWithin `./dist/node` are the folders `v10`, `v12`, `v14`, each of which\ncontaining the Typescript compilation based on\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#node-10-tsconfigjson).\nfor those environments. All the versions are the exact same code as of this\nwriting, so we default Node to using `node/v14`.\n\n### Browser\n\nThe file at `./dist/browser/index.js` is the result of transpiling the result of\nthe `ESNext` code above using [Parcel](http://parceljs.org/). The result is a\nsingle minified file, appropriate for use in a CDN. It exposes the module under\nthe global `FunPromise` namespace.\n\n### React Native\n\nWithin `./dist/react-native` is the result of transpiling the result with\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#react-native-tsconfigjson)\nfor React Native. The distribution is specified in `package.json` under the\n`\"reactNative\"` key,\n[which you can configure Metro to prefer](https://facebook.github.io/metro/docs/configuration/#resolvermainfields).\n\n## Documentation\n\nThe full documentation (including this content) is available on\n[GitHub Pages](https://robertfischer.github.io/fun-promises/).\n\n### Specifications\n\nOur test specs are\n[published here](https://robertfischer.github.io/fun-promises/test-results.txt).\n","readmeFilename":"README.md","gitHead":"2c1a7d91b9d573d8b803b65cae073c6f39ba86a7","bugs":{"url":"https://github.com/RobertFischer/fun-promises/issues"},"_id":"fun-promises@2.0.0-rc.2","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-6efuCX9p9RfpPwcv+HVLxjbg5w6ncAZL1PuWaP+2hAJb2p8IhALu2Qc4Vl3awlq4JTD4XcFolz9YHJThe34P8A==","shasum":"ad9ef06a66612d470a33f0164b428032fea39bd8","tarball":"https://registry.npmjs.org/fun-promises/-/fun-promises-2.0.0-rc.2.tgz","fileCount":112,"unpackedSize":1052011,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0ZEPCRA9TVsSAnZWagAA5oUP/1CclTIJUFEdcyxmEnXQ\nD4RhKK28rvka6p54SfBmKnA/SMFx+eq3MxjvZu31cVIiS9zwLExaLeNp7DB3\nYfvbZqUyF7O95RdxA0f5q2kfnSpyVZEaJZa8vbTpgyv+Ewf6+RUmwEoz/Cx6\nZwkiuFIyGcDjag/hp4+CPv1DkSxUS+QdsK8yHAfs4dazoTu6QOv5WjxPNfcQ\nRwCpVAvbv1tSBHvOJHbg75vZJqikCizQjnuMNTTebsj83NytXiGsh19tCYwt\ntCHahp1kr7SH8dHIfqRlLiFuo3Ljd9ZFsDNVXbdBTWxU/LFnY0ggKuEvAX+A\nCIv71SxxbKpoo8pCxZI11i81FGQT57h2Usp6Ih4DIdQZICuxWLH1W48kFTee\nIPH8PXax87AiwQ+b66Bx7ssShz5QhN5Fz8GOuV6yoPBjLdulR5hrrLqan1iG\nOh0EasuFCRHJmmh9UhL9OoiDR0D/0KnO+lSfq+l+XIP0zEajgVf+sI8uRFO4\nlfEBSxxLPSVfbyOMuvBQKNmToN39qR7xnWI1RsTUlDfS97G4xVCiaGbivUA4\nuKyrHk8aUvzAvA2TNGu4mkgRNMHEeUOOenoZpCAp9FYGOKv0uGBCu4TF6kGL\nBOqyBw2aID9oyIVPhp/iJEkKltjau+H3Zez1WYjJu+9VjienyH/4wK4S1kR6\nnRq7\r\n=7Uy1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCctmuuTFLaNh7i7I8cH7WE4JPIllGm8zEF73nKdGUIcgIhALinvwnQ5u/tXXO7ZSRaIFErX/OoKI/YvRpHMuFpFUbc"}]},"_npmUser":{"name":"robertfischer","email":"smokejumperit@gmail.com"},"directories":{},"maintainers":[{"name":"robertfischer","email":"smokejumperit@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fun-promises_2.0.0-rc.2_1607569678817_0.7021867896314862"},"_hasShrinkwrap":false,"deprecated":"Deprecated in favor of 2.0.1-rc.3"},"2.0.0":{"name":"fun-promises","version":"2.0.0","description":"A library for making Promises more friendly, fluent, and fun(ctional).","main":"dist/node/v14/index.js","module":"dist/es6/esm/index.js","browser":"dist/browser/index.js","reactNative":"dist/react-native/index.js","source":"index.ts","repository":{"type":"git","url":"git+ssh://git@github.com/RobertFischer/fun-promises.git"},"author":{"name":"Robert Fischer"},"license":"Unlicense","private":false,"keywords":["async","asyncawait","await","bluebird","concurrency","concurrently","deferred","deferreds","flow control","functional programming","functional","future","futures","map","mapper","parallel","promise","promises","promises-a","promises-aplus","typescript"],"homepage":"https://robertfischer.github.io/fun-promises/","dependencies":{"@babel/runtime-corejs3":"^7.12.5","core-js":"^3.8.1","debug":"^4.3.1","lodash":"^4.17.20","ts-nested-error":"^1.2.1","tslib":"^2.0.3","typescript":"^4.1.2"},"devDependencies":{"@babel/cli":"^7.12.10","@babel/core":"^7.12.10","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-runtime":"^7.12.10","@babel/preset-env":"^7.12.10","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/github":"^7.2.0","@semantic-release/npm":"^7.0.9","@semantic-release/release-notes-generator":"^9.0.1","@tsconfig/node10":"^1.0.7","@tsconfig/node12":"^1.0.7","@tsconfig/node14":"^1.0.0","@tsconfig/react-native":"^1.0.2","@types/debug":"^4.1.5","@types/lodash":"^4.14.165","babel-minify":"^0.5.1","babel-plugin-import":"^1.13.3","babel-plugin-minify-dead-code-elimination":"^0.5.1","babel-plugin-minify-simplify":"^0.5.1","babel-plugin-remove-debug":"^0.0.4","conventional-changelog-conventionalcommits":"^4.5.0","cz-conventional-changelog":"^3.3.0","husky":"^4.3.5","jest":"^26.6.3","jest-extended":"^0.11.5","lint-staged":"^10.5.3","parcel":"^1.12.4","prettier":"^2.2.1","semantic-release":"^17.3.0","semantic-release-npm-deprecate-old-versions":"^1.0.1","ts-jest":"^26.4.4","typedoc":"^0.19.2","typedoc-plugin-nojekyll":"^1.0.1"},"scripts":{"build":"echo 'Executing build' && yarn build:dists && yarn build:docs","build:amd":"tsc -p ./tsconfig/amd.json","build:browser":"( test -d ./dist/esnext || yarn build:esnext ) && parcel build ./dist/esnext/index.js --target browser --out-dir ./dist/browser/ --global FunPromise --detailed-report 15","build:bundle":"./script/bootstrap && yarn build:dists && ./script/bundle-dists","build:cjs":"tsc -p ./tsconfig/cjs.json","build:dists":"rm -rf dist && yarn build:esnext && yarn build:es6 && yarn build:node && yarn build:react-native && yarn build:browser","build:docs":"rm -rf ./docs && yarn build:docs:typedocs && yarn build:docs:changelog && yarn build:docs:test && yarn build:docs:coverage && mkdir -p ./dist && tar cJvf ./dist/docs.tar.xz ./docs","build:docs:changelog":"cp ./CHANGELOG.md ./docs/ || true","build:docs:coverage":"mkdir -p ./docs && npx browserslist --update-db && (( echo 'Explicitly Supported Browsers (MUST support Promises)' && npx browserslist && npx browserslist --coverage && npx browserslist --coverage=US && echo 'Note that functionally equivalent but unlisted browsers do not count in these stats, so real coverage is much higher than the percentages reported.' ) | tee ./docs/coverage.txt)","build:docs:test":"yarn test --verbose 2>&1 | tee ./docs/test-results.txt","build:docs:typedocs":"typedoc --tsconfig tsconfig.json --gitRevision \"$(git rev-parse --short HEAD)\"","build:es6":"yarn build:cjs && yarn build:esm && yarn build:umd && yarn build:amd","build:esm":"tsc -p ./tsconfig/esm.json","build:esnext":"tsc -p tsconfig.json","build:node":"yarn build:node:10 && yarn build:node:12 && yarn build:node:14","build:node:10":"tsc -p ./tsconfig/node10.json","build:node:12":"tsc -p ./tsconfig/node12.json","build:node:14":"tsc -p ./tsconfig/node14.json","build:react-native":"tsc -p ./tsconfig/react-native.json","build:umd":"tsc -p ./tsconfig/umd.json","bump-deps":"yarn upgrade -LCA && yarn install && yarn test","clean":"./script/clean","polish":"prettier --write .","prepack":"echo 'Executing prepack' && yarn build:dists","serve:docs":"yarn build:docs && npx http-server ./docs","test":"jest --detectOpenHandles --forceExit ./*.test.js ./src/*.test.js","watch:compile":"tsc --watch -p tsconfig.json","watch:test":"yarn test --watch","posttest":"yarn clean"},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"yarn test && yarn build:esnext","prepare-commit-msg":"./script/has-message \"$1\" || ( exec < /dev/tty && git cz --hook )"}},"lint-staged":{"*.(js|cjs|mjs|json|yaml|yml|md|css|htm|htm|ts)":"prettier --write","*.json":"jq ."},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"sideEffects":false,"browserslist":["defaults, cover 95% and supports promises","not dead"],"gitHead":"ffa816a85529726930232d7e1e864a1253ea3559","bugs":{"url":"https://github.com/RobertFischer/fun-promises/issues"},"_id":"fun-promises@2.0.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-OeMjLLB7ZdoZv1tdQHSW+X9afcUCitxXr5cV2Ymv11i7pDl7N8H5m3xRUTrtQuJfqnJRyt6q25danroZJ1hnnA==","shasum":"f8bc525820a1db318110ffd55e01aed47a0efe22","tarball":"https://registry.npmjs.org/fun-promises/-/fun-promises-2.0.0.tgz","fileCount":112,"unpackedSize":1052741,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0ZYuCRA9TVsSAnZWagAANZMP/3WlcRs+BOu/2m+j2qOS\nlV9OAonCZFeumNpiNlnK1aA12googo2CublesKKlKiBQXR3eRh3zKPSiU1PI\n9bOwoOJEMgR6+FirU93A7FF2fjbmfgctOPMYYFTzOslzKwbrJHz6+3vwRYFA\n2f98KrFjF/tWCwystFT1TxSdmpL5Os0saPYlUBdyjzVaXMmt+MgNM+VUBKzi\n5y27XsM9YN5BvIY9ciDKiIwJ3/3hvD7R3abOz/iH/CIfoRg/+spfghTh4cQG\nx3uHKfeOhy/kczCCErYeO6Kig4lPXBLfyV1UtLewulcfYSzGK33AkIwriitd\nJORFswmO40NvO1W8g6LPxhoKrvZBHn/BnHdBNx+TojeKQr1lc9s55fqkNpSt\nhzBiJ50bVfG0deFTIqgc9RkpqaRHOATA5JOWZde4exHyThRdgnFxUh70sk+b\nuwx0JE4E5oelyWFal0udPKJNzHD8s59WF0EvUOZmSVj3iy0RhP4DabQc029R\nVEy3/AuLwI8IsG0evD6kUIILyhU1HLgQyicc75T+S8jgZWPVVQ4osCyShLDf\nDd8DE+o9M58wg6FWsHOCAMGZjnj5xFymVoB6528B+26hATdYkuS8/o0fXmrp\n4PsjYXi4kLmx0vvTEg/H6d1sdhM6sjj5nHO5bMho1VCVPFNkKRQtRRUow5fr\nYCxN\r\n=ofyM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFKDjbK+cEzjPz2/G7btTBRaEBXJV+3PA2AkzzWEWK2IAiBKBeeYaDMNtVnm+tH0w7ubTLSaCdflPtuT2s+XyT1nSw=="}]},"_npmUser":{"name":"robertfischer","email":"smokejumperit@gmail.com"},"directories":{},"maintainers":[{"name":"robertfischer","email":"smokejumperit@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fun-promises_2.0.0_1607570990004_0.6914328618956322"},"_hasShrinkwrap":false,"deprecated":"Deprecated in favor of 2.0.1-rc.3"},"2.0.1-rc.1":{"name":"fun-promises","version":"2.0.1-rc.1","description":"A library for making Promises more friendly, fluent, and fun(ctional).","main":"dist/node/v14/index.js","module":"dist/es6/esm/index.js","browser":"dist/browser/index.js","reactNative":"dist/react-native/index.js","source":"index.ts","repository":{"type":"git","url":"git+ssh://git@github.com/RobertFischer/fun-promises.git"},"author":{"name":"Robert Fischer"},"license":"Unlicense","private":false,"keywords":["async","asyncawait","await","bluebird","concurrency","concurrently","deferred","deferreds","flow control","functional programming","functional","future","futures","map","mapper","parallel","promise","promises","promises-a","promises-aplus","typescript"],"homepage":"https://robertfischer.github.io/fun-promises/","dependencies":{"@babel/runtime-corejs3":"^7.12.5","core-js":"^3.8.1","debug":"^4.3.1","lodash":"^4.17.20","ts-nested-error":"^1.2.1","tslib":"^2.0.3","typescript":"^4.1.2"},"devDependencies":{"@babel/cli":"^7.12.10","@babel/core":"^7.12.10","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-runtime":"^7.12.10","@babel/preset-env":"^7.12.10","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/github":"^7.2.0","@semantic-release/npm":"^7.0.9","@semantic-release/release-notes-generator":"^9.0.1","@tsconfig/node10":"^1.0.7","@tsconfig/node12":"^1.0.7","@tsconfig/node14":"^1.0.0","@tsconfig/react-native":"^1.0.2","@types/debug":"^4.1.5","@types/lodash":"^4.14.165","babel-minify":"^0.5.1","babel-plugin-import":"^1.13.3","babel-plugin-minify-dead-code-elimination":"^0.5.1","babel-plugin-minify-simplify":"^0.5.1","babel-plugin-remove-debug":"^0.0.4","conventional-changelog-conventionalcommits":"^4.5.0","cz-conventional-changelog":"^3.3.0","husky":"^4.3.5","jest":"^26.6.3","jest-extended":"^0.11.5","lint-staged":"^10.5.3","parcel":"^1.12.4","prettier":"^2.2.1","semantic-release":"^17.3.0","semantic-release-npm-deprecate-old-versions":"^1.0.1","ts-jest":"^26.4.4","typedoc":"^0.19.2","typedoc-plugin-nojekyll":"^1.0.1"},"scripts":{"build":"echo 'Executing build' && yarn build:dists && yarn build:docs","build:amd":"tsc -p ./tsconfig/amd.json","build:browser":"( test -d ./dist/esnext || yarn build:esnext ) && parcel build ./dist/esnext/index.js --target browser --out-dir ./dist/browser/ --global FunPromise --detailed-report 15","build:bundle":"./script/bootstrap && yarn build:dists && ./script/bundle-dists","build:cjs":"tsc -p ./tsconfig/cjs.json","build:dists":"rm -rf dist && yarn build:esnext && yarn build:es6 && yarn build:node && yarn build:react-native && yarn build:browser","build:docs":"rm -rf ./docs && yarn build:docs:typedocs && yarn build:docs:changelog && yarn build:docs:test && yarn build:docs:coverage && mkdir -p ./dist && tar cJvf ./dist/docs.tar.xz ./docs","build:docs:changelog":"cp ./CHANGELOG.md ./docs/ || true","build:docs:coverage":"mkdir -p ./docs && npx browserslist --update-db && (( echo 'Explicitly Supported Browsers (MUST support Promises)' && npx browserslist && npx browserslist --coverage && npx browserslist --coverage=US && echo 'Note that functionally equivalent but unlisted browsers do not count in these stats, so real coverage is much higher than the percentages reported.' ) | tee ./docs/coverage.txt)","build:docs:test":"yarn test --verbose 2>&1 | tee ./docs/test-results.txt","build:docs:typedocs":"typedoc --tsconfig tsconfig.json --gitRevision \"$(git rev-parse --short HEAD)\"","build:es6":"yarn build:cjs && yarn build:esm && yarn build:umd && yarn build:amd","build:esm":"tsc -p ./tsconfig/esm.json","build:esnext":"tsc -p tsconfig.json","build:node":"yarn build:node:10 && yarn build:node:12 && yarn build:node:14","build:node:10":"tsc -p ./tsconfig/node10.json","build:node:12":"tsc -p ./tsconfig/node12.json","build:node:14":"tsc -p ./tsconfig/node14.json","build:react-native":"tsc -p ./tsconfig/react-native.json","build:umd":"tsc -p ./tsconfig/umd.json","bump-deps":"yarn upgrade -LCA && yarn install && yarn test","clean":"./script/clean","polish":"prettier --write .","prepack":"echo 'Executing prepack' && yarn build:dists","serve:docs":"yarn build:docs && npx http-server ./docs","test":"jest --detectOpenHandles --forceExit ./*.test.js ./src/*.test.js","watch:compile":"tsc --watch -p tsconfig.json","watch:test":"yarn test --watch","posttest":"yarn clean"},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"yarn test && yarn build:esnext","prepare-commit-msg":"./script/has-message \"$1\" || ( exec < /dev/tty && git cz --hook )"}},"lint-staged":{"*.(js|cjs|mjs|json|yaml|yml|md|css|htm|htm|ts)":"prettier --write","*.json":"jq ."},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"sideEffects":false,"browserslist":["defaults, cover 95% and supports promises","not dead"],"readme":"<!-- @format -->\n\n# fun-promises\n\n**A library for making Promises more friendly, fluent, and fun(ctional).**\n\n## Install\n\n### Yarn\n\n```\nyarn add fun-promises\n```\n\n### npm\n\n```\nnpm install --save fun-promises\n```\n\n### CDN for Browsers\n\nThe following URL contains a script which will set the `FunPromise` global to be\nan object containing the various exports of\n[`index.ts`](https://robertfischer.github.io/fun-promises/modules/_index_.html).\n\n```\nhttps://unpkg.com/browse/fun-promises@latest/dist/browser/index.js\n```\n\n## Usage\n\n### ES Modules\n\n```\nimport FunPromise from \"fun-promises\";\n```\n\n### CJS\n\n```\nconst { FunPromise } = require(\"fun-promises\");\n```\n\n## What This Is Not\n\nThis is _not_ an implementation of [Promises/A+](https://promisesaplus.com/). It\nis not a polyfill or a [ponyfill](https://github.com/sindresorhus/ponyfill). In\nfact, it assumes that you have `Promise` available as a global, either through a\npolyfill or natively.\n\n## What This Is\n\nThis is a library that extends the native `Promise` implementation with a number\nof useful utilities, so that your code is faster and easier. It is inspired by\nlibraries like [`bluebird`](http://bluebirdjs.com/) and\n[`rsvp.js`](https://github.com/tildeio/rsvp.js/blob/master/README.md), except\nwithout the overhead of providing its own `Promise` implementation. Native\npromises have been competitive in performance since Node 10\n([even `bluebird` says so](https://www.npmjs.com/package/bluebird#note)) but\nthere's a lot of functionality which native `Promises` don't supply. Fun\nPromises gives you that better API without the overhead.\n\n## API\n\n- [FunPromise](http://robertfischer.github.io/fun-promises/classes/_src_fun_promise_.funpromise.html)\n- [Deferral](http://robertfischer.github.io/fun-promises/modules/_src_deferral_.deferral.html)\n- [Types](http://robertfischer.github.io/fun-promises/modules/_src_types_.html)\n\nYou also may want to check out\n[the BDD spec](http://robertfischer.github.io/fun-promises/test-results.txt),\nwhich gives an overview of how we expect these things to work.\n\n## Some Highlights\n\n### `settle` / `settleAll`\n\nThis changes a promise of a value into a promise of an object describing the\nresult. The finally resolved object has a `status` property that is either\n`\"fulfilled\"` or `\"rejected\"`, and also provides access to the reason or value.\n\n### `Deferral` class\n\nThis is an inside-out promise: it gives you access to the `resolve` and `reject`\nmethods of the promise so that you can perform operations on them later, as well\nas having accessor to query the state of `promise`.\n\n### `try`\n\n```typescript\nFunPromise.try(() => doSomething(explosivelyFailingParamCalculation()));\nFunPromise.try(async () => {\n\t/* do stuff */ await something; /* do more stuff */\n});\n```\n\nWrap your execution in a promise, so that even its invocation\n[won't release Zalgo](https://blog.izs.me/2013/08/designing-apis-for-asynchrony),\nor as a convinent way to build a `FunPromise` off of an `async` function.\n\n### `tap`\n\n```typescript\nsomeExpensiveOperation()\n\t.tap((value) => debug(\"Value from someExpensiveOperation\", value))\n\t.then(/* ... */);\n```\n\nThis lets you take a look at a resolved value without risking changing it. This\nis extremely useful for debugging log messages.\n\n### `race`\n\n```typescript\ngetRelatedShows().race((someShow) => renderSuggestedShow(someShow));\n```\n\nFire off a bunch of promises and return whichever one resolves first. (The\nresults of any later-resolving promises are discarded.)\n\n### `coalesce`\n\n```typescript\nFunPromise.coalesce([\n\tlookupUserInMemoryCache,\n\tlookupUserInRedisCache,\n\tlookupUserInDB,\n]).then((data) => renderUserData(data));\n```\n\nGiven a bunch of functions that return either values or promises of values,\nexecute them sequentially and return the first one what resolves.\n\n### Types\n\nThere are types that represent unwrapped promise values\n([`Unpromise`](https://robertfischer.github.io/fun-promises/modules/_src_types_.html#unpromise)),\nthings that may be promises or values\n([`Promisable`](https://robertfischer.github.io/fun-promises/modules/_src_types_.html#promisable)),\nand\n[a few others that are a lot more esoteric](https://robertfischer.github.io/fun-promises/modules/_src_types_.html).\n\n_NOTE_: Compiling these types requires a recent version of TypeScript (4.1 or\ngreater) due to conditional recursive types being unavailable in 3.x and buggy\nin 4.0.x.\n\n## Distributions\n\nBy default, your packager should automatically grab the appropriate distribution\nthrough the `package.json` configuration within this library. If you're curious\nor if you have a weird use case, then each distribution has a few different\nflavors of the codebase to choose from. These all live under the `./dist`\ndirectory.\n\n### ESNext\n\nWithin `./dist/esnext` is the result of the Typescript compilation with the\n[\"ESNext\" `module` setting](https://www.typescriptlang.org/tsconfig#module) and\nthe [\"ESNext\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\nNote that it is subject to change as new ECMAScript standards are put out and\nTypescript's JavaScript generation continues to catch up to them, and mostly\nexists for developers to see code that results from compilation.\n\n### ES6\n\nWithin `./dist/es6` are the folders `amd`, `umd`, `cjs` (CommonJS), and `esm`\n(ECMAScript Modules). These contain the result of the Typescript compilation\nwith the corresponding\n[`module` setting](https://www.typescriptlang.org/tsconfig#module) and the\n[\"ES6\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\n\nThe only single-file distribution is the `es6/amd` distribution.\n\n### Node\n\nWithin `./dist/node` are the folders `v10`, `v12`, `v14`, each of which\ncontaining the Typescript compilation based on\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#node-10-tsconfigjson).\nfor those environments. All the versions are the exact same code as of this\nwriting, so we default Node to using `node/v14`.\n\n### Browser\n\nThe file at `./dist/browser/index.js` is the result of transpiling the result of\nthe `ESNext` code above using [Parcel](http://parceljs.org/). The result is a\nsingle minified file, appropriate for use in a CDN. It exposes the module under\nthe global `FunPromise` namespace.\n\n### React Native\n\nWithin `./dist/react-native` is the result of transpiling the result with\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#react-native-tsconfigjson)\nfor React Native. The distribution is specified in `package.json` under the\n`\"reactNative\"` key,\n[which you can configure Metro to prefer](https://facebook.github.io/metro/docs/configuration/#resolvermainfields).\n\n## Documentation\n\nThe full documentation (including this content) is available on\n[GitHub Pages](https://robertfischer.github.io/fun-promises/).\n\n### Specifications\n\nOur test specs are\n[published here](https://robertfischer.github.io/fun-promises/test-results.txt).\n","readmeFilename":"README.md","gitHead":"b4221daa019eb302c869bc34c066606d9b3f1f98","bugs":{"url":"https://github.com/RobertFischer/fun-promises/issues"},"_id":"fun-promises@2.0.1-rc.1","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-y5VMaRcLhrrEUHq84UxCMel1HCkQw02mnrQRps846Ht16B8FkJKtcyaxFTzSeZUCzcEmJItfqkzbXXVbmhu7Hg==","shasum":"751d57789ef0052e384da146443613e54f7cead8","tarball":"https://registry.npmjs.org/fun-promises/-/fun-promises-2.0.1-rc.1.tgz","fileCount":112,"unpackedSize":1047167,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0nh7CRA9TVsSAnZWagAAS1cQAIywj4ZTVB/Eu1R4hc7t\nzcfiMr6zt57udxhAITn9P/HhfnIb3yBdR8ESMI8q5LEDKNJEhPvljXHMWmob\nArepfXaUH/NS2Nck7V9LVRi8DFTx7u8aHCsQ471CI+W2t4VYwQM5Ugh8CVIt\nxWscaMVCXeJ0K7T0W/Ie2kgLdUSCkFzpim8nlKTEvFZqc4E1Z4x8ezf/b1PC\n4DffZYzOshrAWiJ9jvdpOVcqhlrN3SwZl9qh6Zidmq9PTIyCeMjAfPusTrsg\niVCvCsE4j3yUddr9U/MxWnDK21yp1mprAtXMhp8HERtZb4Ap9cP9jwbH+yn3\nHV7VogA9ie/7MAp32Lbz4MlZiRfcAokiaajdb0FtiAD/iDYFgOSbam89fayA\ni+S+EMnZDq4JA8fzLOyU1NRiqq43B65MVyMQhJpzL/WmWLl9Qh28MKnXTuq8\np36RhTMPUpaeJLq6ApXnu7RMax41sQ5Ek89A6lheUQ6A05lprOh72q7P/ZRc\n3TEzkBoEqFAgZbWyT5kdvWOiZ2MDLzntKrszxtp2owzZVcDjvjhP7FnSLZk6\nfsNGRTyaNzHqsBwcO6goUuNLKBBSe+1tUNfb1m8/Rg/EQMukRx9oX5QpWdZS\nvxjZhWpDGn77E5lxypPejSZRhg0YsaytuhKzG7GJEUWWRXtFZmxcSTXggXVF\nIcpX\r\n=arCm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCH1F7JHgQmUaEFLqABYHIXm1soda+j1F6ql1bwAGYt+wCICa1f1uwGXnF1b/aem63OHrFi9GN8kYHBMmBlPa/PCLh"}]},"_npmUser":{"name":"robertfischer","email":"smokejumperit@gmail.com"},"directories":{},"maintainers":[{"name":"robertfischer","email":"smokejumperit@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fun-promises_2.0.1-rc.1_1607628922883_0.3364413728660516"},"_hasShrinkwrap":false,"deprecated":"Deprecated in favor of 2.0.1-rc.3"},"2.0.1-rc.2":{"name":"fun-promises","version":"2.0.1-rc.2","description":"A library for making Promises more friendly, fluent, and fun(ctional).","main":"dist/node/v14/index.js","module":"dist/es6/esm/index.js","browser":"dist/browser/index.js","reactNative":"dist/react-native/index.js","source":"index.ts","repository":{"type":"git","url":"git+ssh://git@github.com/RobertFischer/fun-promises.git"},"author":{"name":"Robert Fischer"},"license":"Unlicense","private":false,"keywords":["async","asyncawait","await","bluebird","concurrency","concurrently","deferred","deferreds","flow control","functional programming","functional","future","futures","map","mapper","parallel","promise","promises","promises-a","promises-aplus","typescript"],"homepage":"https://robertfischer.github.io/fun-promises/","dependencies":{"@babel/runtime-corejs3":"^7.12.5","core-js":"^3.8.1","debug":"^4.3.1","lodash":"^4.17.20","ts-nested-error":"^1.2.1","tslib":"^2.0.3","typescript":"^4.1.2"},"devDependencies":{"@babel/cli":"^7.12.10","@babel/core":"^7.12.10","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-runtime":"^7.12.10","@babel/preset-env":"^7.12.10","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/github":"^7.2.0","@semantic-release/npm":"^7.0.9","@semantic-release/release-notes-generator":"^9.0.1","@tsconfig/node10":"^1.0.7","@tsconfig/node12":"^1.0.7","@tsconfig/node14":"^1.0.0","@tsconfig/react-native":"^1.0.2","@types/debug":"^4.1.5","@types/lodash":"^4.14.165","babel-minify":"^0.5.1","babel-plugin-import":"^1.13.3","babel-plugin-minify-dead-code-elimination":"^0.5.1","babel-plugin-minify-simplify":"^0.5.1","babel-plugin-remove-debug":"^0.0.4","conventional-changelog-conventionalcommits":"^4.5.0","cz-conventional-changelog":"^3.3.0","husky":"^4.3.5","jest":"^26.6.3","jest-extended":"^0.11.5","lint-staged":"^10.5.3","parcel":"^1.12.4","prettier":"^2.2.1","semantic-release":"^17.3.0","semantic-release-npm-deprecate-old-versions":"^1.0.1","ts-jest":"^26.4.4","typedoc":"^0.19.2","typedoc-plugin-nojekyll":"^1.0.1"},"scripts":{"build":"echo 'Executing build' && yarn build:dists && yarn build:docs","build:amd":"tsc -p ./tsconfig/amd.json","build:browser":"( test -d ./dist/esnext || yarn build:esnext ) && parcel build ./dist/esnext/index.js --target browser --out-dir ./dist/browser/ --global FunPromise --detailed-report 15","build:bundle":"./script/bootstrap && yarn build:dists && ./script/bundle-dists","build:cjs":"tsc -p ./tsconfig/cjs.json","build:dists":"rm -rf dist && yarn build:esnext && yarn build:es6 && yarn build:node && yarn build:react-native && yarn build:browser","build:docs":"rm -rf ./docs && yarn build:docs:typedocs && yarn build:docs:changelog && yarn build:docs:test && yarn build:docs:coverage && mkdir -p ./dist && tar cJvf ./dist/docs.tar.xz ./docs","build:docs:changelog":"cp ./CHANGELOG.md ./docs/ || true","build:docs:coverage":"mkdir -p ./docs && npx browserslist --update-db && (( echo 'Explicitly Supported Browsers (MUST support Promises)' && npx browserslist && npx browserslist --coverage && npx browserslist --coverage=US && echo 'Note that functionally equivalent but unlisted browsers do not count in these stats, so real coverage is much higher than the percentages reported.' ) | tee ./docs/coverage.txt)","build:docs:test":"yarn test --verbose 2>&1 | tee ./docs/test-results.txt","build:docs:typedocs":"typedoc --tsconfig tsconfig.json --gitRevision \"$(git rev-parse --short HEAD)\"","build:es6":"yarn build:cjs && yarn build:esm && yarn build:umd && yarn build:amd","build:esm":"tsc -p ./tsconfig/esm.json","build:esnext":"tsc -p tsconfig.json","build:node":"yarn build:node:10 && yarn build:node:12 && yarn build:node:14","build:node:10":"tsc -p ./tsconfig/node10.json","build:node:12":"tsc -p ./tsconfig/node12.json","build:node:14":"tsc -p ./tsconfig/node14.json","build:react-native":"tsc -p ./tsconfig/react-native.json","build:umd":"tsc -p ./tsconfig/umd.json","bump-deps":"yarn upgrade -LCA && yarn install && yarn test","clean":"./script/clean","polish":"prettier --write .","prepack":"echo 'Executing prepack' && yarn build:dists","serve:docs":"yarn build:docs && npx http-server ./docs","test":"jest --detectOpenHandles --forceExit ./*.test.js ./src/*.test.js","watch:compile":"tsc --watch -p tsconfig.json","watch:test":"yarn test --watch","posttest":"yarn clean"},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"yarn test && yarn build:esnext","prepare-commit-msg":"./script/has-message \"$1\" || ( exec < /dev/tty && git cz --hook )"}},"lint-staged":{"*.(js|cjs|mjs|json|yaml|yml|md|css|htm|htm|ts)":"prettier --write","*.json":"jq ."},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"sideEffects":false,"browserslist":["defaults, cover 95% and supports promises","not dead"],"readme":"<!-- @format -->\n\n# fun-promises\n\n**A library for making Promises more friendly, fluent, and fun(ctional).**\n\n## Install\n\n### Yarn\n\n```\nyarn add fun-promises\n```\n\n### npm\n\n```\nnpm install --save fun-promises\n```\n\n### CDN for Browsers\n\nThe following URL contains a script which will set the `FunPromise` global to be\nan object containing the various exports of\n[`index.ts`](https://robertfischer.github.io/fun-promises/modules/_index_.html).\n\n```\nhttps://unpkg.com/browse/fun-promises@latest/dist/browser/index.js\n```\n\n## Usage\n\n### ES Modules\n\n```\nimport FunPromise from \"fun-promises\";\n```\n\n### CJS\n\n```\nconst { FunPromise } = require(\"fun-promises\");\n```\n\n## What This Is Not\n\nThis is _not_ an implementation of [Promises/A+](https://promisesaplus.com/). It\nis not a polyfill or a [ponyfill](https://github.com/sindresorhus/ponyfill). In\nfact, it assumes that you have `Promise` available as a global, either through a\npolyfill or natively.\n\n## What This Is\n\nThis is a library that extends the native `Promise` implementation with a number\nof useful utilities, so that your code is faster and easier. It is inspired by\nlibraries like [`bluebird`](http://bluebirdjs.com/) and\n[`rsvp.js`](https://github.com/tildeio/rsvp.js/blob/master/README.md), except\nwithout the overhead of providing its own `Promise` implementation. Native\npromises have been competitive in performance since Node 10\n([even `bluebird` says so](https://www.npmjs.com/package/bluebird#note)) but\nthere's a lot of functionality which native `Promises` don't supply. Fun\nPromises gives you that better API without the overhead.\n\n## API\n\n- [FunPromise](http://robertfischer.github.io/fun-promises/classes/_src_fun_promise_.funpromise.html)\n- [Deferral](http://robertfischer.github.io/fun-promises/modules/_src_deferral_.deferral.html)\n- [Types](http://robertfischer.github.io/fun-promises/modules/_src_types_.html)\n\nYou also may want to check out\n[the BDD spec](http://robertfischer.github.io/fun-promises/test-results.txt),\nwhich gives an overview of how we expect these things to work.\n\n## Some Highlights\n\n### `settle` / `settleAll`\n\nThis changes a promise of a value into a promise of an object describing the\nresult. The finally resolved object has a `status` property that is either\n`\"fulfilled\"` or `\"rejected\"`, and also provides access to the reason or value.\n\n### `Deferral` class\n\nThis is an inside-out promise: it gives you access to the `resolve` and `reject`\nmethods of the promise so that you can perform operations on them later, as well\nas having accessor to query the state of `promise`.\n\n### `try`\n\n```typescript\nFunPromise.try(() => doSomething(explosivelyFailingParamCalculation()));\nFunPromise.try(async () => {\n\t/* do stuff */ await something; /* do more stuff */\n});\n```\n\nWrap your execution in a promise, so that even its invocation\n[won't release Zalgo](https://blog.izs.me/2013/08/designing-apis-for-asynchrony),\nor as a convinent way to build a `FunPromise` off of an `async` function.\n\n### `tap`\n\n```typescript\nsomeExpensiveOperation()\n\t.tap((value) => debug(\"Value from someExpensiveOperation\", value))\n\t.then(/* ... */);\n```\n\nThis lets you take a look at a resolved value without risking changing it. This\nis extremely useful for debugging log messages.\n\n### `race`\n\n```typescript\ngetRelatedShows().race((someShow) => renderSuggestedShow(someShow));\n```\n\nFire off a bunch of promises and return whichever one resolves first. (The\nresults of any later-resolving promises are discarded.)\n\n### `coalesce`\n\n```typescript\nFunPromise.coalesce([\n\tlookupUserInMemoryCache,\n\tlookupUserInRedisCache,\n\tlookupUserInDB,\n]).then((data) => renderUserData(data));\n```\n\nGiven a bunch of functions that return either values or promises of values,\nexecute them sequentially and return the first one what resolves.\n\n### Types\n\nThere are types that represent unwrapped promise values\n([`Unpromise`](https://robertfischer.github.io/fun-promises/modules/_src_types_.html#unpromise)),\nthings that may be promises or values\n([`Promisable`](https://robertfischer.github.io/fun-promises/modules/_src_types_.html#promisable)),\nand\n[a few others that are a lot more esoteric](https://robertfischer.github.io/fun-promises/modules/_src_types_.html).\n\n_NOTE_: Compiling these types requires a recent version of TypeScript (4.1 or\ngreater) due to conditional recursive types being unavailable in 3.x and buggy\nin 4.0.x.\n\n## Distributions\n\nBy default, your packager should automatically grab the appropriate distribution\nthrough the `package.json` configuration within this library. If you're curious\nor if you have a weird use case, then each distribution has a few different\nflavors of the codebase to choose from. These all live under the `./dist`\ndirectory.\n\n### ESNext\n\nWithin `./dist/esnext` is the result of the Typescript compilation with the\n[\"ESNext\" `module` setting](https://www.typescriptlang.org/tsconfig#module) and\nthe [\"ESNext\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\nNote that it is subject to change as new ECMAScript standards are put out and\nTypescript's JavaScript generation continues to catch up to them, and mostly\nexists for developers to see code that results from compilation.\n\n### ES6\n\nWithin `./dist/es6` are the folders `amd`, `umd`, `cjs` (CommonJS), and `esm`\n(ECMAScript Modules). These contain the result of the Typescript compilation\nwith the corresponding\n[`module` setting](https://www.typescriptlang.org/tsconfig#module) and the\n[\"ES6\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\n\nThe only single-file distribution is the `es6/amd` distribution.\n\n### Node\n\nWithin `./dist/node` are the folders `v10`, `v12`, `v14`, each of which\ncontaining the Typescript compilation based on\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#node-10-tsconfigjson).\nfor those environments. All the versions are the exact same code as of this\nwriting, so we default Node to using `node/v14`.\n\n### Browser\n\nThe file at `./dist/browser/index.js` is the result of transpiling the result of\nthe `ESNext` code above using [Parcel](http://parceljs.org/). The result is a\nsingle minified file, appropriate for use in a CDN. It exposes the module under\nthe global `FunPromise` namespace.\n\n### React Native\n\nWithin `./dist/react-native` is the result of transpiling the result with\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#react-native-tsconfigjson)\nfor React Native. The distribution is specified in `package.json` under the\n`\"reactNative\"` key,\n[which you can configure Metro to prefer](https://facebook.github.io/metro/docs/configuration/#resolvermainfields).\n\n## Documentation\n\nThe full documentation (including this content) is available on\n[GitHub Pages](https://robertfischer.github.io/fun-promises/).\n\n### Specifications\n\nOur test specs are\n[published here](https://robertfischer.github.io/fun-promises/test-results.txt).\n","readmeFilename":"README.md","gitHead":"28d1fc73e5c1f75c2491399ce080cd1c2171aad5","bugs":{"url":"https://github.com/RobertFischer/fun-promises/issues"},"_id":"fun-promises@2.0.1-rc.2","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ZXw+dHH/1fRnb1CeTBGl6KqoXdm2yDJKOqwBRTaNyPobcCl4NoTvwxlA2EevQEliOOfSg5xmyT3M/DvssRPzCA==","shasum":"899e48025f22d6fbd9fbc6e0d893da9036b0661f","tarball":"https://registry.npmjs.org/fun-promises/-/fun-promises-2.0.1-rc.2.tgz","fileCount":112,"unpackedSize":1048426,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0plPCRA9TVsSAnZWagAAcl4P/28Onmj7M8NcLgwuBnmj\n4BrRmEmqVvxIDv0KvJzjFlQEAz9dhd+YISI62K9KXQcHl4kciWcV6y8zIpOp\nDx+Np5sLpkfW4ZCO31HmgBb0wdBfTqRyvrw63Z1W2Qy9dOuPS9GhQN5YhEVl\nJy7hTBnP/BlHCK+OiVvuegho9y+kixo9PTE0oJkVBrAwu7WyEkSDU+C4CMXI\noGP7LwVrDwu0uY9W4J53DkVPLDMyjKY+dMUhXOSfiIt/UmuQCPzA9dY0L6Op\nSEr6mNT3KDnPmZC8UVP4tvT7L+xUzFE6rI/BpXxSnSGiu8SUEBsI6oc5PB90\n/tuCVdmMN1g7vgPKf3BJueUfpH7bUFP9XZIbRUdWhZSwIT5IcunpmxpSnJEN\nqc6oNNppczHA5sv2LFr/706c1G2QCWDZTkk84X496dsY6UFFivUTdAaYH04A\nfLybH8wWMlbJTrV86dPKlcVHK5iU3DEDckFPnlNbEQ7GcOCKiZrDSFElwuJv\nTpD8OUuXkO58DLwxzW6xUCAGq8tCnHvSgTFCAmwLGwEamUI7KtAAoH5Z02L2\nomi+c/wvA0kJy+Sgc87zGFqU3W9nGHZ3NhX3IERUj6a6SCRsBoPYO5R6zPCG\nVe9BhdFxhjlAOK5KYU8ryh0Ij710kxsHVrYujj3D2T6Amgse+5oRtlxWNqZx\nvJEf\r\n=qhqs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDmfVzlbfQPUsnc4nZJLc+D9HAnTmVzlcgkZjUTnp3MgAiEAtImrL18W0FNmPtfQ+ed77Go/mWtxjXAia7AuoaAlhUU="}]},"_npmUser":{"name":"robertfischer","email":"smokejumperit@gmail.com"},"directories":{},"maintainers":[{"name":"robertfischer","email":"smokejumperit@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fun-promises_2.0.1-rc.2_1607637327285_0.016876292808726046"},"_hasShrinkwrap":false,"deprecated":"Deprecated in favor of 2.0.1-rc.3"},"2.0.1-rc.3":{"name":"fun-promises","version":"2.0.1-rc.3","description":"A library for making Promises more friendly, fluent, and fun(ctional).","main":"dist/node/v14/index.js","module":"dist/es6/esm/index.js","browser":"dist/browser/index.js","reactNative":"dist/react-native/index.js","source":"index.ts","types":"dist/esnext/index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/RobertFischer/fun-promises.git"},"author":{"name":"Robert Fischer"},"license":"Unlicense","private":false,"keywords":["async","asyncawait","await","bluebird","concurrency","concurrently","deferred","deferreds","flow control","functional programming","functional","future","futures","map","mapper","parallel","promise","promises","promises-a","promises-aplus","typescript"],"homepage":"https://robertfischer.github.io/fun-promises/","dependencies":{"@babel/runtime-corejs3":"^7.12.5","core-js":"^3.8.1","debug":"^4.3.1","lodash":"^4.17.20","ts-nested-error":"^1.2.1","tslib":"^2.0.3","typescript":"^4.1.2"},"devDependencies":{"@babel/cli":"^7.12.10","@babel/core":"^7.12.10","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-runtime":"^7.12.10","@babel/preset-env":"^7.12.10","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/github":"^7.2.0","@semantic-release/npm":"^7.0.9","@semantic-release/release-notes-generator":"^9.0.1","@tsconfig/node10":"^1.0.7","@tsconfig/node12":"^1.0.7","@tsconfig/node14":"^1.0.0","@tsconfig/react-native":"^1.0.2","@types/debug":"^4.1.5","@types/lodash":"^4.14.165","babel-minify":"^0.5.1","babel-plugin-import":"^1.13.3","babel-plugin-minify-dead-code-elimination":"^0.5.1","babel-plugin-minify-simplify":"^0.5.1","babel-plugin-remove-debug":"^0.0.4","conventional-changelog-conventionalcommits":"^4.5.0","cz-conventional-changelog":"^3.3.0","husky":"^4.3.5","jest":"^26.6.3","jest-extended":"^0.11.5","lint-staged":"^10.5.3","parcel":"^1.12.4","prettier":"^2.2.1","semantic-release":"^17.3.0","semantic-release-npm-deprecate-old-versions":"^1.0.1","ts-jest":"^26.4.4","typedoc":"^0.19.2","typedoc-plugin-nojekyll":"^1.0.1"},"scripts":{"build":"echo 'Executing build' && yarn build:dists && yarn build:docs","build:amd":"tsc -p ./tsconfig/amd.json","build:browser":"( test -d ./dist/esnext || yarn build:esnext ) && parcel build ./dist/esnext/index.js --target browser --out-dir ./dist/browser/ --global FunPromise --detailed-report 15","build:bundle":"./script/bootstrap && yarn build:dists && ./script/bundle-dists","build:cjs":"tsc -p ./tsconfig/cjs.json","build:dists":"rm -rf dist && yarn build:esnext && yarn build:es6 && yarn build:node && yarn build:react-native && yarn build:browser","build:docs":"rm -rf ./docs && yarn build:docs:typedocs && yarn build:docs:changelog && yarn build:docs:test && yarn build:docs:coverage && mkdir -p ./dist && tar cJvf ./dist/docs.tar.xz ./docs","build:docs:changelog":"cp ./CHANGELOG.md ./docs/ || true","build:docs:coverage":"mkdir -p ./docs && npx browserslist --update-db && (( echo 'Explicitly Supported Browsers (MUST support Promises)' && npx browserslist && npx browserslist --coverage && npx browserslist --coverage=US && echo 'Note that functionally equivalent but unlisted browsers do not count in these stats, so real coverage is much higher than the percentages reported.' ) | tee ./docs/coverage.txt)","build:docs:test":"yarn test --verbose 2>&1 | tee ./docs/test-results.txt","build:docs:typedocs":"typedoc --tsconfig tsconfig.json --gitRevision \"$(git rev-parse --short HEAD)\"","build:es6":"yarn build:cjs && yarn build:esm && yarn build:umd && yarn build:amd","build:esm":"tsc -p ./tsconfig/esm.json","build:esnext":"tsc -p tsconfig.json","build:node":"yarn build:node:10 && yarn build:node:12 && yarn build:node:14","build:node:10":"tsc -p ./tsconfig/node10.json","build:node:12":"tsc -p ./tsconfig/node12.json","build:node:14":"tsc -p ./tsconfig/node14.json","build:react-native":"tsc -p ./tsconfig/react-native.json","build:umd":"tsc -p ./tsconfig/umd.json","bump-deps":"yarn upgrade -LCA && yarn install && yarn test","clean":"./script/clean","polish":"prettier --write .","prepack":"echo 'Executing prepack' && yarn build:dists","serve:docs":"yarn build:docs && npx http-server ./docs","test":"jest --detectOpenHandles --forceExit ./*.test.js ./src/*.test.js","watch:compile":"tsc --watch -p tsconfig.json","watch:test":"yarn test --watch","posttest":"yarn clean"},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"yarn test && yarn build:esnext","prepare-commit-msg":"./script/has-message \"$1\" || ( exec < /dev/tty && git cz --hook )"}},"lint-staged":{"*.(js|cjs|mjs|json|yaml|yml|md|css|htm|htm|ts)":"prettier --write","*.json":"jq ."},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"sideEffects":false,"browserslist":["defaults, cover 95% and supports promises","not dead"],"readme":"<!-- @format -->\n\n# fun-promises\n\n**A library for making Promises more friendly, fluent, and fun(ctional).**\n\n## Install\n\n### Yarn\n\n```\nyarn add fun-promises\n```\n\n### npm\n\n```\nnpm install --save fun-promises\n```\n\n### CDN for Browsers\n\nThe following URL contains a script which will set the `FunPromise` global to be\nan object containing the various exports of\n[`index.ts`](https://robertfischer.github.io/fun-promises/modules/_index_.html).\n\n```\nhttps://unpkg.com/browse/fun-promises@latest/dist/browser/index.js\n```\n\n## Usage\n\n### ES Modules\n\n```\nimport FunPromise from \"fun-promises\";\n```\n\n### CJS\n\n```\nconst { FunPromise } = require(\"fun-promises\");\n```\n\n## What This Is Not\n\nThis is _not_ an implementation of [Promises/A+](https://promisesaplus.com/). It\nis not a polyfill or a [ponyfill](https://github.com/sindresorhus/ponyfill). In\nfact, it assumes that you have `Promise` available as a global, either through a\npolyfill or natively.\n\n## What This Is\n\nThis is a library that extends the native `Promise` implementation with a number\nof useful utilities, so that your code is faster and easier. It is inspired by\nlibraries like [`bluebird`](http://bluebirdjs.com/) and\n[`rsvp.js`](https://github.com/tildeio/rsvp.js/blob/master/README.md), except\nwithout the overhead of providing its own `Promise` implementation. Native\npromises have been competitive in performance since Node 10\n([even `bluebird` says so](https://www.npmjs.com/package/bluebird#note)) but\nthere's a lot of functionality which native `Promises` don't supply. Fun\nPromises gives you that better API without the overhead.\n\n## API\n\n- [FunPromise](http://robertfischer.github.io/fun-promises/classes/_src_fun_promise_.funpromise.html)\n- [Deferral](http://robertfischer.github.io/fun-promises/modules/_src_deferral_.deferral.html)\n- [Types](http://robertfischer.github.io/fun-promises/modules/_src_types_.html)\n\nYou also may want to check out\n[the BDD spec](http://robertfischer.github.io/fun-promises/test-results.txt),\nwhich gives an overview of how we expect these things to work.\n\n## Some Highlights\n\n### `settle` / `settleAll`\n\nThis changes a promise of a value into a promise of an object describing the\nresult. The finally resolved object has a `status` property that is either\n`\"fulfilled\"` or `\"rejected\"`, and also provides access to the reason or value.\n\n### `Deferral` class\n\nThis is an inside-out promise: it gives you access to the `resolve` and `reject`\nmethods of the promise so that you can perform operations on them later, as well\nas having accessor to query the state of `promise`.\n\n### `try`\n\n```typescript\nFunPromise.try(() => doSomething(explosivelyFailingParamCalculation()));\nFunPromise.try(async () => {\n\t/* do stuff */ await something; /* do more stuff */\n});\n```\n\nWrap your execution in a promise, so that even its invocation\n[won't release Zalgo](https://blog.izs.me/2013/08/designing-apis-for-asynchrony),\nor as a convinent way to build a `FunPromise` off of an `async` function.\n\n### `tap`\n\n```typescript\nsomeExpensiveOperation()\n\t.tap((value) => debug(\"Value from someExpensiveOperation\", value))\n\t.then(/* ... */);\n```\n\nThis lets you take a look at a resolved value without risking changing it. This\nis extremely useful for debugging log messages.\n\n### `race`\n\n```typescript\ngetRelatedShows().race((someShow) => renderSuggestedShow(someShow));\n```\n\nFire off a bunch of promises and return whichever one resolves first. (The\nresults of any later-resolving promises are discarded.)\n\n### `coalesce`\n\n```typescript\nFunPromise.coalesce([\n\tlookupUserInMemoryCache,\n\tlookupUserInRedisCache,\n\tlookupUserInDB,\n]).then((data) => renderUserData(data));\n```\n\nGiven a bunch of functions that return either values or promises of values,\nexecute them sequentially and return the first one what resolves.\n\n### Types\n\nThere are types that represent unwrapped promise values\n([`Unpromise`](https://robertfischer.github.io/fun-promises/modules/_src_types_.html#unpromise)),\nthings that may be promises or values\n([`Promisable`](https://robertfischer.github.io/fun-promises/modules/_src_types_.html#promisable)),\nand\n[a few others that are a lot more esoteric](https://robertfischer.github.io/fun-promises/modules/_src_types_.html).\n\n_NOTE_: Compiling these types requires a recent version of TypeScript (4.1 or\ngreater) due to conditional recursive types being unavailable in 3.x and buggy\nin 4.0.x.\n\n## Distributions\n\nBy default, your packager should automatically grab the appropriate distribution\nthrough the `package.json` configuration within this library. If you're curious\nor if you have a weird use case, then each distribution has a few different\nflavors of the codebase to choose from. These all live under the `./dist`\ndirectory.\n\n### ESNext\n\nWithin `./dist/esnext` is the result of the Typescript compilation with the\n[\"ESNext\" `module` setting](https://www.typescriptlang.org/tsconfig#module) and\nthe [\"ESNext\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\nNote that it is subject to change as new ECMAScript standards are put out and\nTypescript's JavaScript generation continues to catch up to them, and mostly\nexists for developers to see code that results from compilation.\n\n### ES6\n\nWithin `./dist/es6` are the folders `amd`, `umd`, `cjs` (CommonJS), and `esm`\n(ECMAScript Modules). These contain the result of the Typescript compilation\nwith the corresponding\n[`module` setting](https://www.typescriptlang.org/tsconfig#module) and the\n[\"ES6\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\n\nThe only single-file distribution is the `es6/amd` distribution.\n\n### Node\n\nWithin `./dist/node` are the folders `v10`, `v12`, `v14`, each of which\ncontaining the Typescript compilation based on\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#node-10-tsconfigjson).\nfor those environments. All the versions are the exact same code as of this\nwriting, so we default Node to using `node/v14`.\n\n### Browser\n\nThe file at `./dist/browser/index.js` is the result of transpiling the result of\nthe `ESNext` code above using [Parcel](http://parceljs.org/). The result is a\nsingle minified file, appropriate for use in a CDN. It exposes the module under\nthe global `FunPromise` namespace.\n\n### React Native\n\nWithin `./dist/react-native` is the result of transpiling the result with\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#react-native-tsconfigjson)\nfor React Native. The distribution is specified in `package.json` under the\n`\"reactNative\"` key,\n[which you can configure Metro to prefer](https://facebook.github.io/metro/docs/configuration/#resolvermainfields).\n\n## Documentation\n\nThe full documentation (including this content) is available on\n[GitHub Pages](https://robertfischer.github.io/fun-promises/).\n\n### Specifications\n\nOur test specs are\n[published here](https://robertfischer.github.io/fun-promises/test-results.txt).\n","readmeFilename":"README.md","gitHead":"e2e3a9c8a0416baba51a9283f4b9f24393911dbf","bugs":{"url":"https://github.com/RobertFischer/fun-promises/issues"},"_id":"fun-promises@2.0.1-rc.3","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-0MHEPbTohdKi3JwUpJZVm147RN1BSXc5A3R/5gJjvTcJJK4LnpiAZ1zZRUeCnUep1yLKlo66p/dfKml/skMFAA==","shasum":"e07b8a8d72bd020349d2c0db362091a5c1cb099c","tarball":"https://registry.npmjs.org/fun-promises/-/fun-promises-2.0.1-rc.3.tgz","fileCount":112,"unpackedSize":1049211,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0sG/CRA9TVsSAnZWagAAloQQAIs1u0KvwJkjVNLGdrkz\ngnqiha3LlHIVU4oG6lrhhSHWvx6wrXXfo6uoBsYHxr/LxRo+zIlhKg6tApQF\n0DMD9O3Rm0UuJWYMnGxwkVAcsU+7iLLp6imKkNFwm1QfXmvhldwWsI9oLf2X\n0dU63QZrTk61AFKQztLC7q9OqlxNdq5WFqQ8MJ/9v1+/rY2YnF9cFfz4z4Fe\nAcY1WqzuyEZWW8T1eUME+D3RKWE4+xA9/5FF62OtaTmtgPWlqwz6DyGYhPs8\nuhuZZ7h2jrd+dpC6NstJ3qfn709V1z8VncmPUdLcDyNmR87NGCk8y2gf29Mj\nTrxfMBIFTX6jdublVJV/ZEeOnk+D1EhblJ87xwAiguWKAiyfn3GSnjGUdGkT\n3J24R0n9oP+C614AwzAKa9Vm4CBCT2vwzkoolPESKm70tFbnZAUkm4LulCdQ\nnr+atMYi2YlXGt0N1bzjBEnfQVSbIIA/CPTvLGs3y6hguzKC3K6fa1FJYEjG\ngGMtfIDuIRnFZsYqsU5iSODc3FviD6/NFBcCfOP7WF6mfr99cNy0lWDCHwg6\nOwZCgmAJdcrD+QKQLB5cPFm4snRtCAL4GYa8zd56vr5VE1dQsamQeF5eD/w5\nh/P8IjAJIwQ3N8IZEF+aeBO6LtzgBsOBBk5JsibG5tCjUvLN+b3cc3rgYcHK\n/3Yx\r\n=I3m1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGSbygLFsBs5KD0XQooHPJJloSQkq5+EhBvmsQgN/4jfAiEA8NaN3wT4SWu6TUT3cvCP03rn052DCCFt8Q59I2cpBzQ="}]},"_npmUser":{"name":"robertfischer","email":"smokejumperit@gmail.com"},"directories":{},"maintainers":[{"name":"robertfischer","email":"smokejumperit@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fun-promises_2.0.1-rc.3_1607647679366_0.4063988468083024"},"_hasShrinkwrap":false},"2.0.2":{"name":"fun-promises","version":"2.0.2","description":"A library for making Promises more friendly, fluent, and fun(ctional).","main":"dist/node/v14/index.js","module":"dist/es6/esm/index.js","browser":"dist/browser/index.js","reactNative":"dist/react-native/index.js","source":"index.ts","types":"dist/esnext/index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/RobertFischer/fun-promises.git"},"author":{"name":"Robert Fischer"},"license":"Unlicense","private":false,"keywords":["async","asyncawait","await","bluebird","concurrency","concurrently","deferred","deferreds","flow control","functional programming","functional","future","futures","map","mapper","parallel","promise","promises","promises-a","promises-aplus","typescript"],"homepage":"https://robertfischer.github.io/fun-promises/","dependencies":{"@babel/runtime-corejs3":"^7.12.5","core-js":"^3.8.1","debug":"^4.3.1","lodash":"^4.17.20","ts-nested-error":"^1.2.1","tslib":"^2.0.3","typescript":"^4.1.2"},"devDependencies":{"@babel/cli":"^7.12.10","@babel/core":"^7.12.10","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-runtime":"^7.12.10","@babel/preset-env":"^7.12.10","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/github":"^7.2.0","@semantic-release/npm":"^7.0.9","@semantic-release/release-notes-generator":"^9.0.1","@tsconfig/node10":"^1.0.7","@tsconfig/node12":"^1.0.7","@tsconfig/node14":"^1.0.0","@tsconfig/react-native":"^1.0.2","@types/debug":"^4.1.5","@types/lodash":"^4.14.165","babel-minify":"^0.5.1","babel-plugin-import":"^1.13.3","babel-plugin-minify-dead-code-elimination":"^0.5.1","babel-plugin-minify-simplify":"^0.5.1","babel-plugin-remove-debug":"^0.0.4","conventional-changelog-conventionalcommits":"^4.5.0","cz-conventional-changelog":"^3.3.0","husky":"^4.3.5","jest":"^26.6.3","jest-extended":"^0.11.5","lint-staged":"^10.5.3","parcel":"^1.12.4","prettier":"^2.2.1","semantic-release":"^17.3.0","semantic-release-npm-deprecate-old-versions":"^1.0.1","ts-jest":"^26.4.4","typedoc":"^0.19.2","typedoc-plugin-nojekyll":"^1.0.1"},"scripts":{"build":"echo 'Executing build' && yarn build:dists && yarn build:docs","build:amd":"tsc -p ./tsconfig/amd.json","build:browser":"( test -d ./dist/esnext || yarn build:esnext ) && parcel build ./dist/esnext/index.js --target browser --out-dir ./dist/browser/ --global FunPromise --detailed-report 15","build:bundle":"./script/bootstrap && yarn build:dists && ./script/bundle-dists","build:cjs":"tsc -p ./tsconfig/cjs.json","build:dists":"rm -rf dist && yarn build:esnext && yarn build:es6 && yarn build:node && yarn build:react-native && yarn build:browser","build:docs":"rm -rf ./docs && mkdir ./docs && yarn build:docs:typedocs && yarn build:docs:changelog && yarn build:docs:test && yarn build:docs:coverage && mkdir -p ./dist && tar cJvf ./dist/docs.tar.xz ./docs","build:docs:changelog":"cp ./CHANGELOG.md ./docs/ || true","build:docs:coverage":"mkdir -p ./docs && npx browserslist --update-db && ( ( echo 'Explicitly Supported Browsers (MUST support Promises)' && npx browserslist && npx browserslist --coverage && npx browserslist --coverage=US && echo 'Note that functionally equivalent but unlisted browsers do not count in these stats, so real coverage is much higher than the percentages reported.' ) | tee ./docs/coverage.txt )","build:docs:test":"yarn test --verbose 2>&1 | tee ./docs/test-results.txt","build:docs:typedocs":"typedoc --tsconfig tsconfig.json --gitRevision \"$(git rev-parse --short HEAD)\"","build:es6":"yarn build:cjs && yarn build:esm && yarn build:umd && yarn build:amd","build:esm":"tsc -p ./tsconfig/esm.json","build:esnext":"tsc -p tsconfig.json","build:node":"yarn build:node:10 && yarn build:node:12 && yarn build:node:14","build:node:10":"tsc -p ./tsconfig/node10.json","build:node:12":"tsc -p ./tsconfig/node12.json","build:node:14":"tsc -p ./tsconfig/node14.json","build:react-native":"tsc -p ./tsconfig/react-native.json","build:umd":"tsc -p ./tsconfig/umd.json","bump-deps":"yarn upgrade -LCA && yarn install && yarn test","clean":"./script/clean","polish":"prettier --write .","prepack":"echo 'Executing prepack' && yarn build:dists","serve:docs":"yarn build:docs && npx http-server ./docs","test":"jest --detectOpenHandles --forceExit ./*.test.js ./src/*.test.js","watch:compile":"tsc --watch -p tsconfig.json","watch:test":"yarn test --watch"},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"yarn test && yarn build:esnext","prepare-commit-msg":"./script/has-message \"$1\" || ( exec < /dev/tty && git cz --hook )"}},"lint-staged":{"*.(js|cjs|mjs|json|yaml|yml|md|css|htm|htm|ts)":"prettier --write","*.json":"jq ."},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"sideEffects":false,"browserslist":["defaults, cover 95% and supports promises","not dead"],"gitHead":"0ca2c2791cbe58a3c430a9c853463dfbd9c2b824","bugs":{"url":"https://github.com/RobertFischer/fun-promises/issues"},"_id":"fun-promises@2.0.2","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-fy+qe6urkPgqCLBVTobxxHmQFg+anBbkzFxwatfkLXXBcxcGUdMsEUb+MbIqPHL504Ao1bY6uvKNmM60UOzmbA==","shasum":"a067594a7e7c62f30666d2dd4f784267e299b1c4","tarball":"https://registry.npmjs.org/fun-promises/-/fun-promises-2.0.2.tgz","fileCount":112,"unpackedSize":1049735,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf07ZECRA9TVsSAnZWagAAn9YP/1jUQU3GfleNjpWw2dHp\nI/6IUeeY5De2Y4kTBHFyv/0y2lIEOOBZoLsK4mp+JisKj1L7KGOu1InEUng2\nfHA1t1YBK1tYe+lbmXyNVvKjTIu7P7p5R0/eE+1aHszr8QYhy1DlS7SvULSV\nLEp/G7dIFqPHkFRDAzhp5U3PUlCG0/93Lk9StdcQGbF71r4ovLeVpvtELA3n\niQv+lg2beyWhNoK6jkiE6ZUWGyso5/ZdtZNvDDLZI830TuuGXftVblFwA9U1\n6G03ETmu0JVxFtDtXLirdFRht/kTuEbFm+3m4iYddgfNeTnKkLW9epQx/xkU\nvjAm+ojBlEYqg6EOSkkRGIdo+j+kLEI+yrNxoqdfUORWhDNeU9SSL7E5JfRA\nYE5uYIxvFsUWqa13a5C9dIAIztB0vSZtznBy2JZwCOsBtEI7QRfg7URDcd5g\nmKqI2FYXIIjbf+WL+L+QcOjXbZl9P2WS22T4U65eONBix3iO5wQWMrOMCZ9N\n1q63FdfQrFAP5m1y+tlbw77IMHSuQ26kcy7DDjuwz9dDs1d2SYEkfR/6+Oaz\nGtIHfEbjv6aqavVk0M6YPRZbL1om+5LPlSepVnf9qn4uluckQtVB+CpwOI/m\nNa9gmmrXT0t51m2OQSWbpQ4Yzme6KJTj6LM0uxjrPaXdjOkg+0hX3I+ow8lM\nzeDJ\r\n=CN62\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICYJJ6er8gLMH2MZDE/NG4StVlD7pRtxi5o5+ARzTUUQAiEAlMzMkMIf7ypBhgIO7hEzmnGCUjKesylNDdJKdyER7t0="}]},"_npmUser":{"name":"robertfischer","email":"smokejumperit@gmail.com"},"directories":{},"maintainers":[{"name":"robertfischer","email":"smokejumperit@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fun-promises_2.0.2_1607710275816_0.4652328818033198"},"_hasShrinkwrap":false,"deprecated":"Deprecated in favor of 2.0.1-rc.3"},"2.1.0-rc.1":{"name":"fun-promises","version":"2.1.0-rc.1","description":"A library for making Promises more friendly, fluent, and fun(ctional).","main":"dist/node/v14/index.js","module":"dist/es6/esm/index.js","browser":"dist/browser/index.js","reactNative":"dist/react-native/index.js","source":"index.ts","types":"dist/esnext/index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/RobertFischer/fun-promises.git"},"author":{"name":"Robert Fischer"},"license":"Unlicense","private":false,"keywords":["async","asyncawait","await","bluebird","concurrency","concurrently","deferred","deferreds","flow control","functional programming","functional","future","futures","map","mapper","parallel","promise","promises","promises-a","promises-aplus","typescript"],"homepage":"https://robertfischer.github.io/fun-promises/","dependencies":{"@babel/runtime-corejs3":"^7.12.5","core-js":"^3.8.1","debug":"^4.3.1","lodash":"^4.17.20","ts-nested-error":"^1.2.1","tslib":"^2.0.3","typescript":"^4.1.2"},"devDependencies":{"@babel/cli":"^7.12.10","@babel/core":"^7.12.10","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-runtime":"^7.12.10","@babel/preset-env":"^7.12.10","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/github":"^7.2.0","@semantic-release/npm":"^7.0.9","@semantic-release/release-notes-generator":"^9.0.1","@tsconfig/node10":"^1.0.7","@tsconfig/node12":"^1.0.7","@tsconfig/node14":"^1.0.0","@tsconfig/react-native":"^1.0.2","@types/debug":"^4.1.5","@types/lodash":"^4.14.165","babel-minify":"^0.5.1","babel-plugin-import":"^1.13.3","babel-plugin-minify-dead-code-elimination":"^0.5.1","babel-plugin-minify-simplify":"^0.5.1","babel-plugin-remove-debug":"^0.0.4","conventional-changelog-conventionalcommits":"^4.5.0","cz-conventional-changelog":"^3.3.0","husky":"^4.3.5","jest":"^26.6.3","jest-extended":"^0.11.5","lint-staged":"^10.5.3","parcel":"^1.12.4","prettier":"^2.2.1","semantic-release":"^17.3.0","semantic-release-npm-deprecate-old-versions":"^1.0.1","ts-jest":"^26.4.4","typedoc":"^0.19.2","typedoc-plugin-nojekyll":"^1.0.1"},"scripts":{"build":"echo 'Executing build' && yarn build:bundles && yarn build:docs","build:amd":"tsc -p ./tsconfig/amd.json","build:browser":"( test -d ./dist/esnext || yarn build:esnext ) && parcel build ./dist/esnext/index.js --target browser --out-dir ./dist/browser/ --global FunPromise --detailed-report 15","build:bundles":"./script/bootstrap && yarn build:dists && ./script/bundle-dists","build:cjs":"tsc -p ./tsconfig/cjs.json","build:dists":"rm -rf dist && yarn build:esnext && yarn build:es6 && yarn build:node && yarn build:react-native && yarn build:browser","build:docs":"rm -rf ./docs && mkdir ./docs && yarn build:docs:typedocs && yarn build:docs:changelog && yarn build:docs:test && yarn build:docs:coverage && mkdir -p ./dist && tar cJvf ./dist/docs.tar.xz ./docs","build:docs:changelog":"cp ./CHANGELOG.md ./docs/ || true","build:docs:coverage":"mkdir -p ./docs && npx browserslist --update-db && ( ( echo 'Explicitly Supported Browsers (MUST support Promises)' && npx browserslist && npx browserslist --coverage && npx browserslist --coverage=US && echo 'Note that functionally equivalent but unlisted browsers do not count in these stats, so real coverage is much higher than the percentages reported.' ) | tee ./docs/coverage.txt )","build:docs:test":"yarn test --verbose 2>&1 | tee ./docs/test-results.txt","build:docs:typedocs":"typedoc --tsconfig tsconfig.json --gitRevision \"$(git rev-parse --short HEAD)\"","build:es6":"yarn build:cjs && yarn build:esm && yarn build:umd && yarn build:amd","build:esm":"tsc -p ./tsconfig/esm.json","build:esnext":"tsc -p tsconfig.json","build:node":"yarn build:node:10 && yarn build:node:12 && yarn build:node:14","build:node:10":"tsc -p ./tsconfig/node10.json","build:node:12":"tsc -p ./tsconfig/node12.json","build:node:14":"tsc -p ./tsconfig/node14.json","build:react-native":"tsc -p ./tsconfig/react-native.json","build:umd":"tsc -p ./tsconfig/umd.json","bump-deps":"yarn upgrade -LCA && yarn install && yarn test","clean":"./script/clean","polish":"prettier --write .","prepack":"echo 'Executing prepack' && yarn build:bundles","serve:docs":"yarn build:docs && npx http-server ./docs","test":"jest --detectOpenHandles --forceExit ./*.test.js ./src/*.test.js","watch:compile":"tsc --watch -p tsconfig.json","watch:test":"yarn test --watch"},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"yarn test && yarn build:esnext","prepare-commit-msg":"./script/has-message \"$1\" || ( exec < /dev/tty && git cz --hook )"}},"lint-staged":{"*.(js|cjs|mjs|json|yaml|yml|md|css|htm|htm|ts)":"prettier --write","*.json":"jq ."},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"sideEffects":false,"browserslist":["defaults, cover 95% and supports promises","not dead"],"readme":"<!-- @format -->\n\n# fun-promises\n\n**A library for making Promises more friendly, fluent, and fun(ctional).**\n\n## Install\n\n### Yarn\n\n```\nyarn add fun-promises\n```\n\n### npm\n\n```\nnpm install --save fun-promises\n```\n\n### CDN for Browsers\n\nThe following URL contains a script which will set the `FunPromises` global to\nbe an object containing the various exports of\n[`index.ts`](https://robertfischer.github.io/fun-promises/modules/_index_.html).\n\n```\nhttps://unpkg.com/browse/fun-promises@latest/dist/browser/index.js\n```\n\n## Usage\n\n### ES Modules\n\n```\nimport FunPromise from \"fun-promises\";\n```\n\n### CJS\n\n```\nconst { FunPromise } = require(\"fun-promises\");\n```\n\n## What This Is Not\n\nThis is _not_ an implementation of [Promises/A+](https://promisesaplus.com/). It\nis not a polyfill or a [ponyfill](https://github.com/sindresorhus/ponyfill). In\nfact, it assumes that you have `Promise` available as a global, either through a\npolyfill or natively.\n\n## What This Is\n\nThis is a library that extends the native `Promise` implementation with a number\nof useful utilities, so that your code is faster and easier. It is inspired by\nlibraries like [`bluebird`](http://bluebirdjs.com/) and\n[`rsvp.js`](https://github.com/tildeio/rsvp.js/blob/master/README.md), except\nwithout the overhead of providing its own `Promise` implementation. Native\npromises have been competitive in performance since Node 10\n([even `bluebird` says so](https://www.npmjs.com/package/bluebird#note)) but\nthere's a lot of functionality which native `Promises` don't supply. Fun\nPromises gives you that better API without the overhead.\n\n## API\n\n- [FunPromise](http://robertfischer.github.io/fun-promises/classes/_src_fun_promise_.funpromise.html)\n- [Deferral](http://robertfischer.github.io/fun-promises/modules/_src_deferral_.deferral.html)\n- [Types](http://robertfischer.github.io/fun-promises/modules/_src_types_.html)\n\nYou also may want to check out\n[the BDD spec](http://robertfischer.github.io/fun-promises/test-results.txt),\nwhich gives an overview of how we expect these things to work.\n\n## Some Highlights\n\n### `settle` / `settleAll`\n\nThis changes a promise of a value into a promise of an object describing the\nresult. The finally resolved object has a `status` property that is either\n`\"fulfilled\"` or `\"rejected\"`, and also provides access to the reason or value.\n\n### `Deferral` class\n\nThis is an inside-out promise: it gives you access to the `resolve` and `reject`\nmethods of the promise so that you can perform operations on them later, as well\nas having accessor to query the state of `promise`.\n\n### `try`\n\n```typescript\nFunPromise.try(() => doSomething(explosivelyFailingParamCalculation()));\nFunPromise.try(async () => {\n\t/* do stuff */ await something; /* do more stuff */\n});\n```\n\nWrap your execution in a promise, so that even its invocation\n[won't release Zalgo](https://blog.izs.me/2013/08/designing-apis-for-asynchrony),\nor as a convinent way to build a `FunPromise` off of an `async` function.\n\n### `tap`\n\n```typescript\nsomeExpensiveOperation()\n\t.tap((value) => debug(\"Value from someExpensiveOperation\", value))\n\t.then(/* ... */);\n```\n\nThis lets you take a look at a resolved value without risking changing it. This\nis extremely useful for debugging log messages.\n\n### `race`\n\n```typescript\ngetRelatedShows().race((someShow) => renderSuggestedShow(someShow));\n```\n\nFire off a bunch of promises and return whichever one resolves first. (The\nresults of any later-resolving promises are discarded.)\n\n### `coalesce`\n\n```typescript\nFunPromise.coalesce([\n\tlookupUserInMemoryCache,\n\tlookupUserInRedisCache,\n\tlookupUserInDB,\n]).then((data) => renderUserData(data));\n```\n\nGiven a bunch of functions that return either values or promises of values,\nexecute them sequentially and return the first one what resolves.\n\n### Types\n\nThere are types that represent unwrapped promise values\n([`Unpromise`](https://robertfischer.github.io/fun-promises/modules/_src_types_.html#unpromise)),\nthings that may be promises or values\n([`Promisable`](https://robertfischer.github.io/fun-promises/modules/_src_types_.html#promisable)),\nand\n[a few others that are a lot more esoteric](https://robertfischer.github.io/fun-promises/modules/_src_types_.html).\n\n_NOTE_: Compiling these types requires a recent version of TypeScript (4.1 or\ngreater) due to conditional recursive types being unavailable in 3.x and buggy\nin 4.0.x.\n\n## Distributions\n\nBy default, your packager should automatically grab the appropriate distribution\nthrough the `package.json` configuration within this library. If you're curious\nor if you have a weird use case, then each distribution has a few different\nflavors of the codebase to choose from. These all live under the `./dist`\ndirectory.\n\n### ESNext\n\nWithin `./dist/esnext` is the result of the Typescript compilation with the\n[\"ESNext\" `module` setting](https://www.typescriptlang.org/tsconfig#module) and\nthe [\"ESNext\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\nNote that it is subject to change as new ECMAScript standards are put out and\nTypescript's JavaScript generation continues to catch up to them, and mostly\nexists for developers to see code that results from compilation.\n\n### ES6\n\nWithin `./dist/es6` are the folders `amd`, `umd`, `cjs` (CommonJS), and `esm`\n(ECMAScript Modules). These contain the result of the Typescript compilation\nwith the corresponding\n[`module` setting](https://www.typescriptlang.org/tsconfig#module) and the\n[\"ES6\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\n\nThe only single-file distribution is the `es6/amd` distribution.\n\n### Node\n\nWithin `./dist/node` are the folders `v10`, `v12`, `v14`, each of which\ncontaining the Typescript compilation based on\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#node-10-tsconfigjson).\nfor those environments. All the versions are the exact same code as of this\nwriting, so we default Node to using `node/v14`.\n\n### Browser\n\nThe file at `./dist/browser/index.js` is the result of transpiling the result of\nthe `ESNext` code above using [Parcel](http://parceljs.org/). The result is a\nsingle minified file, appropriate for use in a CDN. It exposes the module under\nthe global `FunPromise` namespace.\n\n### React Native\n\nWithin `./dist/react-native` is the result of transpiling the result with\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#react-native-tsconfigjson)\nfor React Native. The distribution is specified in `package.json` under the\n`\"reactNative\"` key,\n[which you can configure Metro to prefer](https://facebook.github.io/metro/docs/configuration/#resolvermainfields).\n\n## Documentation\n\nThe full documentation (including this content) is available on\n[GitHub Pages](https://robertfischer.github.io/fun-promises/).\n\n### Specifications\n\nOur test specs are\n[published here](https://robertfischer.github.io/fun-promises/test-results.txt).\n","readmeFilename":"README.md","gitHead":"70cb0e057848bdc051802676955ea5b6cbaf3707","bugs":{"url":"https://github.com/RobertFischer/fun-promises/issues"},"_id":"fun-promises@2.1.0-rc.1","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-o1b+fG4b6jcLben8zmhEmXA94PXzRT/CFFAKcGb6A7iSx1QX3Va3JlesDf9yIR/kgt7v5oGaFzMZoxpO0dJdfQ==","shasum":"fc50053bf8d2368a57e5f5ecc3e9a003be917e5f","tarball":"https://registry.npmjs.org/fun-promises/-/fun-promises-2.1.0-rc.1.tgz","fileCount":122,"unpackedSize":1077693,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf1lQQCRA9TVsSAnZWagAATeoP/3JoAhewoEi+ytuXimQg\n4iUxFs5J0VzVLcFpITWbrwIL+QKjjSpJ1D0dXFaWr4ZuHsZFUosWCJQWdVye\nViqKX3rMCgsgE4JE8uNX68/5r9M8NIZjXjiEjSEXFzK9YrzipggEwpF6S/sH\nf3xNIqC+0jpNYXUDEkuVnzpOphTo/omnPcMgak2+cwLQiK9/s4pj0RDmy5ET\nAjZ8KF8dV5/C32CrlfMIoFXBrESl732MQJFf0drcmRwlf+MVhOWuxGFEemBz\nFCozVnCtlMYLCHe5s9cEmlFVne562KZNUlcN5zI5D8BUfbv1dC+yX4Lwfg0i\nNFB41u3Ld0YQQ/aTASaNG9Ce8vno0eP/q/V4uGWyQ191aAnq+dRoZZoJeYKK\nZvMoKnPqw1LYNeVsyt/hIW4fxdfBnDr04FsBNPbf783+aSJVTOLkRoXXsfHs\ne8UZCk66Q6wXvp/hcmzZwmPYCyFNlSQUxYegzYM6NgU/K35AO3FCawmYN7LT\nVDDXY9vGjQG5S36hw0pS9yMKL7h4Ufs9dsKy88/yigmanMgGxZB/VLMDMSXC\nZxov6OblOuOry66r3oC4giraoH+CrBpNbHi2IxZnMDq8GYsk1lmwB4G5sfwZ\n4yRWqvKXoSZnq9LPidGELAGMvT2PvDTnvyjnuCFe3uGSqTPT/bt3WfCi8Nj9\n3TeT\r\n=OZjK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCAOOqgv9ltEq41XZRt5jkt5rzIOsdFnBg4tGcDiY6XqQIgQRoQPX7w1uoCmcFW/f367EG+tLga2huz/r+eKbAh5b4="}]},"_npmUser":{"name":"robertfischer","email":"smokejumperit@gmail.com"},"directories":{},"maintainers":[{"name":"robertfischer","email":"smokejumperit@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fun-promises_2.1.0-rc.1_1607881744349_0.15313610515287035"},"_hasShrinkwrap":false,"deprecated":"Deprecated in favor of 2.1.0-rc.2"},"2.1.0-rc.2":{"name":"fun-promises","version":"2.1.0-rc.2","description":"A library for making Promises more friendly, fluent, and fun(ctional).","main":"dist/node/v14/index.js","module":"dist/es6/esm/index.js","browser":"dist/browser/index.js","reactNative":"dist/react-native/index.js","source":"index.ts","types":"dist/esnext/index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/RobertFischer/fun-promises.git"},"author":{"name":"Robert Fischer"},"license":"Unlicense","private":false,"keywords":["async","asyncawait","await","bluebird","concurrency","concurrently","deferred","deferreds","flow control","functional programming","functional","future","futures","map","mapper","parallel","promise","promises","promises-a","promises-aplus","typescript"],"homepage":"https://robertfischer.github.io/fun-promises/","dependencies":{"@babel/runtime-corejs3":"^7.12.5","core-js":"^3.8.1","debug":"^4.3.1","lodash":"^4.17.20","ts-nested-error":"^1.2.1","tslib":"^2.0.3","typescript":"^4.1.3"},"devDependencies":{"@babel/cli":"^7.12.10","@babel/core":"^7.12.10","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-runtime":"^7.12.10","@babel/preset-env":"^7.12.10","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/github":"^7.2.0","@semantic-release/npm":"^7.0.9","@semantic-release/release-notes-generator":"^9.0.1","@tsconfig/node10":"^1.0.7","@tsconfig/node12":"^1.0.7","@tsconfig/node14":"^1.0.0","@tsconfig/react-native":"^1.0.2","@types/debug":"^4.1.5","@types/lodash":"^4.14.165","babel-minify":"^0.5.1","babel-plugin-import":"^1.13.3","babel-plugin-minify-dead-code-elimination":"^0.5.1","babel-plugin-minify-simplify":"^0.5.1","babel-plugin-remove-debug":"^0.0.4","conventional-changelog-conventionalcommits":"^4.5.0","cz-conventional-changelog":"^3.3.0","husky":"^4.3.6","jest":"^26.6.3","jest-extended":"^0.11.5","lint-staged":"^10.5.3","parcel":"^1.12.4","prettier":"^2.2.1","semantic-release":"^17.3.0","semantic-release-npm-deprecate-old-versions":"^1.0.1","ts-jest":"^26.4.4","typedoc":"^0.19.2","typedoc-plugin-nojekyll":"^1.0.1"},"scripts":{"build":"echo 'Executing build' && yarn build:bundles && yarn build:docs","build:amd":"tsc -p ./tsconfig/amd.json","build:browser":"( test -d ./dist/esnext || yarn build:esnext ) && parcel build ./dist/esnext/index.js --target browser --out-dir ./dist/browser/ --global FunPromise --detailed-report 15","build:bundles":"./script/bootstrap && yarn build:dists && ./script/bundle-dists","build:cjs":"tsc -p ./tsconfig/cjs.json","build:dists":"rm -rf dist && yarn build:esnext && yarn build:es6 && yarn build:node && yarn build:react-native && yarn build:browser","build:docs":"rm -rf ./docs && mkdir ./docs && yarn build:docs:typedocs && yarn build:docs:changelog && yarn build:docs:test && yarn build:docs:coverage && mkdir -p ./dist && tar cJvf ./dist/docs.tar.xz ./docs","build:docs:changelog":"cp ./CHANGELOG.md ./docs/ || true","build:docs:coverage":"mkdir -p ./docs && npx browserslist --update-db && ( ( echo 'Explicitly Supported Browsers (MUST support Promises)' && npx browserslist && npx browserslist --coverage && npx browserslist --coverage=US && echo 'Note that functionally equivalent but unlisted browsers do not count in these stats, so real coverage is much higher than the percentages reported.' ) | tee ./docs/coverage.txt )","build:docs:test":"yarn test --verbose 2>&1 | tee ./docs/test-results.txt","build:docs:typedocs":"typedoc --tsconfig tsconfig.json --gitRevision \"$(git rev-parse --short HEAD)\"","build:es6":"yarn build:cjs && yarn build:esm && yarn build:umd && yarn build:amd","build:esm":"tsc -p ./tsconfig/esm.json","build:esnext":"tsc -p tsconfig.json","build:node":"yarn build:node:10 && yarn build:node:12 && yarn build:node:14","build:node:10":"tsc -p ./tsconfig/node10.json","build:node:12":"tsc -p ./tsconfig/node12.json","build:node:14":"tsc -p ./tsconfig/node14.json","build:react-native":"tsc -p ./tsconfig/react-native.json","build:umd":"tsc -p ./tsconfig/umd.json","bump-deps":"yarn upgrade -LCA && yarn install && yarn test","clean":"./script/clean","polish":"prettier --write .","prepack":"echo 'Executing prepack' && yarn build:bundles","serve:docs":"yarn build:docs && npx http-server ./docs","test":"jest --detectOpenHandles --forceExit ./*.test.js ./src/*.test.js","watch:compile":"tsc --watch -p tsconfig.json","watch:test":"yarn test --watch"},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"yarn test && yarn build:esnext","prepare-commit-msg":"./script/has-message \"$1\" || ( exec < /dev/tty && git cz --hook )"}},"lint-staged":{"*.(js|cjs|mjs|json|yaml|yml|md|css|htm|htm|ts)":"prettier --write","*.json":"jq ."},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"sideEffects":false,"browserslist":["defaults, cover 95% and supports promises","not dead"],"readme":"<!-- @format -->\n\n# fun-promises\n\n**A library for making Promises more friendly, fluent, and fun(ctional).**\n\n## Install\n\n### Yarn\n\n```\nyarn add fun-promises\n```\n\n### npm\n\n```\nnpm install --save fun-promises\n```\n\n### CDN for Browsers\n\nThe following URL contains a script which will set the `FunPromises` global to\nbe an object containing the various exports of\n[`index.ts`](https://robertfischer.github.io/fun-promises/modules/_index_.html).\n\n```\nhttps://unpkg.com/browse/fun-promises@latest/dist/browser/index.js\n```\n\n## Usage\n\n### ES Modules\n\n```\nimport FunPromise from \"fun-promises\";\n```\n\n### CJS\n\n```\nconst { FunPromise } = require(\"fun-promises\");\n```\n\n## What This Is Not\n\nThis is _not_ an implementation of [Promises/A+](https://promisesaplus.com/). It\nis not a polyfill or a [ponyfill](https://github.com/sindresorhus/ponyfill). In\nfact, it assumes that you have `Promise` available as a global, either through a\npolyfill or natively.\n\n## What This Is\n\nThis is a library that extends the native `Promise` implementation with a number\nof useful utilities, so that your code is faster and easier. It is inspired by\nlibraries like [`bluebird`](http://bluebirdjs.com/) and\n[`rsvp.js`](https://github.com/tildeio/rsvp.js/blob/master/README.md), except\nwithout the overhead of providing its own `Promise` implementation. Native\npromises have been competitive in performance since Node 10\n([even `bluebird` says so](https://www.npmjs.com/package/bluebird#note)) but\nthere's a lot of functionality which native `Promises` don't supply. Fun\nPromises gives you that better API without the overhead.\n\n## API\n\n- [FunPromise](http://robertfischer.github.io/fun-promises/classes/_src_fun_promise_.funpromise.html)\n- [Deferral](http://robertfischer.github.io/fun-promises/modules/_src_deferral_.deferral.html)\n- [Types](http://robertfischer.github.io/fun-promises/modules/_src_types_.html)\n\nYou also may want to check out\n[the BDD spec](http://robertfischer.github.io/fun-promises/test-results.txt),\nwhich gives an overview of how we expect these things to work.\n\n## Some Highlights\n\n### `settle` / `settleAll`\n\nThis changes a promise of a value into a promise of an object describing the\nresult. The finally resolved object has a `status` property that is either\n`\"fulfilled\"` or `\"rejected\"`, and also provides access to the reason or value.\n\n### `Deferral` class\n\nThis is an inside-out promise: it gives you access to the `resolve` and `reject`\nmethods of the promise so that you can perform operations on them later, as well\nas having accessor to query the state of `promise`.\n\n### `try`\n\n```typescript\nFunPromise.try(() => doSomething(explosivelyFailingParamCalculation()));\nFunPromise.try(async () => {\n\t/* do stuff */ await something; /* do more stuff */\n});\n```\n\nWrap your execution in a promise, so that even its invocation\n[won't release Zalgo](https://blog.izs.me/2013/08/designing-apis-for-asynchrony),\nor as a convinent way to build a `FunPromise` off of an `async` function.\n\n### `tap`\n\n```typescript\nsomeExpensiveOperation()\n\t.tap((value) => debug(\"Value from someExpensiveOperation\", value))\n\t.then(/* ... */);\n```\n\nThis lets you take a look at a resolved value without risking changing it. This\nis extremely useful for debugging log messages.\n\n### `race`\n\n```typescript\ngetRelatedShows().race((someShow) => renderSuggestedShow(someShow));\n```\n\nFire off a bunch of promises and return whichever one resolves first. (The\nresults of any later-resolving promises are discarded.)\n\n### `coalesce`\n\n```typescript\nFunPromise.coalesce([\n\tlookupUserInMemoryCache,\n\tlookupUserInRedisCache,\n\tlookupUserInDB,\n]).then((data) => renderUserData(data));\n```\n\nGiven a bunch of functions that return either values or promises of values,\nexecute them sequentially and return the first one what resolves.\n\n### Types\n\nThere are types that represent unwrapped promise values\n([`Unpromise`](https://robertfischer.github.io/fun-promises/modules/_src_types_.html#unpromise)),\nthings that may be promises or values\n([`Promisable`](https://robertfischer.github.io/fun-promises/modules/_src_types_.html#promisable)),\nand\n[a few others that are a lot more esoteric](https://robertfischer.github.io/fun-promises/modules/_src_types_.html).\n\n_NOTE_: Compiling these types requires a recent version of TypeScript (4.1 or\ngreater) due to conditional recursive types being unavailable in 3.x and buggy\nin 4.0.x.\n\n## Distributions\n\nBy default, your packager should automatically grab the appropriate distribution\nthrough the `package.json` configuration within this library. If you're curious\nor if you have a weird use case, then each distribution has a few different\nflavors of the codebase to choose from. These all live under the `./dist`\ndirectory.\n\n### ESNext\n\nWithin `./dist/esnext` is the result of the Typescript compilation with the\n[\"ESNext\" `module` setting](https://www.typescriptlang.org/tsconfig#module) and\nthe [\"ESNext\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\nNote that it is subject to change as new ECMAScript standards are put out and\nTypescript's JavaScript generation continues to catch up to them, and mostly\nexists for developers to see code that results from compilation.\n\n### ES6\n\nWithin `./dist/es6` are the folders `amd`, `umd`, `cjs` (CommonJS), and `esm`\n(ECMAScript Modules). These contain the result of the Typescript compilation\nwith the corresponding\n[`module` setting](https://www.typescriptlang.org/tsconfig#module) and the\n[\"ES6\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\n\nThe only single-file distribution is the `es6/amd` distribution.\n\n### Node\n\nWithin `./dist/node` are the folders `v10`, `v12`, `v14`, each of which\ncontaining the Typescript compilation based on\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#node-10-tsconfigjson).\nfor those environments. All the versions are the exact same code as of this\nwriting, so we default Node to using `node/v14`.\n\n### Browser\n\nThe file at `./dist/browser/index.js` is the result of transpiling the result of\nthe `ESNext` code above using [Parcel](http://parceljs.org/). The result is a\nsingle minified file, appropriate for use in a CDN. It exposes the module under\nthe global `FunPromise` namespace.\n\n### React Native\n\nWithin `./dist/react-native` is the result of transpiling the result with\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#react-native-tsconfigjson)\nfor React Native. The distribution is specified in `package.json` under the\n`\"reactNative\"` key,\n[which you can configure Metro to prefer](https://facebook.github.io/metro/docs/configuration/#resolvermainfields).\n\n## Documentation\n\nThe full documentation (including this content) is available on\n[GitHub Pages](https://robertfischer.github.io/fun-promises/).\n\n### Specifications\n\nOur test specs are\n[published here](https://robertfischer.github.io/fun-promises/test-results.txt).\n","readmeFilename":"README.md","gitHead":"e560a82dc245c636753bbcfd347b4fa6637523cb","bugs":{"url":"https://github.com/RobertFischer/fun-promises/issues"},"_id":"fun-promises@2.1.0-rc.2","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-46IwqDg7Zt5wiCbWnxtN+vbNv1xOJ27RuGcIjJkuTE/qcR9reQbCQLVq0jgbthMu9xAqkXxkHuFzKP7in5vUVQ==","shasum":"89f3a5720bd7bdda147c379c9902d31c5eca5904","tarball":"https://registry.npmjs.org/fun-promises/-/fun-promises-2.1.0-rc.2.tgz","fileCount":122,"unpackedSize":1122355,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf19rXCRA9TVsSAnZWagAAv1oP/iQNEkzPKslvIlfMbpLb\nKaOtPqKQujs8GHZJJm21ACnyhfaixm0oKn70/HhQPIQk6PdIBYGAgq2sZRXp\n5UdNPsemcOWWSXgj6Yrrs+QTQ6zcqCDqFRsad6rwCZgFQYhkLiQFaL8CN+j3\nXcy58Gkp9BtyUFEsab2tmLkbqzEWkSlPTfC+GOWmSa8swRSr35KNdllp0mLv\nOUHhv3XLAykHurgYiT5n/aAU4vjwy5Mi86yGqvh13FAkQIBLsE9ReCVS1B3K\nvbGBWhT+Krrc1M50hHVORi4Yoca9qt7GdrvQI0fESXGSKVHzbw6B1kP61UXT\n35P0CQigqslrnPZ+w+gf3otxNkZ/n4cYh7Coj9qp2Vn5ucWy/Ecl/6pgfISS\nbLQSi/+lAxV8TmkYDB3B8TLKnxeVGBIrJ8YxuuP8f51rfQrNVsQokoHoU7gK\nypZ7pxmvW2jzpBi723BWQkrWY0g1ozbfAEO86MO5BxsZqEBoMn35m1ZNqIfN\nmB9E0Pxpa1TMc2BmLRnp5WyB5rn+ykGIuXNimZMyEWJFpRpk7zjOF8M3oKXF\n6bOfQqt24G4Nih0lbT+dWyHonOu/Il5kKnbCmGq1tBcZoLHP5eikVIs3be6g\nGQIOvVdO399tAD5lztzri/wL6ZvEGPKwgk3pU3StkzEJiM4lMYkHfApHTEFL\nrwGe\r\n=vw2e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBko7SRUH4wJxWheF79ZRgJJ1ewGA+NCLHoh6Iqfopr+AiEAw1o0QocPc31YrFXWBMD3OSCu4R2fb33Y5hWutFLms5U="}]},"_npmUser":{"name":"robertfischer","email":"smokejumperit@gmail.com"},"directories":{},"maintainers":[{"name":"robertfischer","email":"smokejumperit@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fun-promises_2.1.0-rc.2_1607981782596_0.4253673276985821"},"_hasShrinkwrap":false,"deprecated":"Deprecated in favor of 2.1.0"},"2.1.0":{"name":"fun-promises","version":"2.1.0","description":"A library for making Promises more friendly, fluent, and fun(ctional).","main":"dist/node/v14/index.js","module":"dist/es6/esm/index.js","browser":"dist/browser/index.js","reactNative":"dist/react-native/index.js","source":"index.ts","types":"dist/esnext/index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/RobertFischer/fun-promises.git"},"author":{"name":"Robert Fischer"},"license":"Unlicense","private":false,"keywords":["async","asyncawait","await","bluebird","concurrency","concurrently","deferred","deferreds","flow control","functional programming","functional","future","futures","map","mapper","parallel","promise","promises","promises-a","promises-aplus","typescript"],"homepage":"https://robertfischer.github.io/fun-promises/","dependencies":{"@babel/runtime-corejs3":"^7.12.5","core-js":"^3.8.1","debug":"^4.3.1","lodash":"^4.17.20","ts-nested-error":"^1.2.1","tslib":"^2.0.3","typescript":"^4.1.3"},"devDependencies":{"@babel/cli":"^7.12.10","@babel/core":"^7.12.10","@babel/plugin-proposal-class-properties":"^7.12.1","@babel/plugin-transform-runtime":"^7.12.10","@babel/preset-env":"^7.12.10","@semantic-release/changelog":"^5.0.1","@semantic-release/commit-analyzer":"^8.0.1","@semantic-release/git":"^9.0.0","@semantic-release/github":"^7.2.0","@semantic-release/npm":"^7.0.9","@semantic-release/release-notes-generator":"^9.0.1","@tsconfig/node10":"^1.0.7","@tsconfig/node12":"^1.0.7","@tsconfig/node14":"^1.0.0","@tsconfig/react-native":"^1.0.2","@types/debug":"^4.1.5","@types/lodash":"^4.14.165","babel-minify":"^0.5.1","babel-plugin-import":"^1.13.3","babel-plugin-minify-dead-code-elimination":"^0.5.1","babel-plugin-minify-simplify":"^0.5.1","babel-plugin-remove-debug":"^0.0.4","conventional-changelog-conventionalcommits":"^4.5.0","cz-conventional-changelog":"^3.3.0","husky":"^4.3.6","jest":"^26.6.3","jest-extended":"^0.11.5","lint-staged":"^10.5.3","parcel":"^1.12.4","prettier":"^2.2.1","semantic-release":"^17.3.0","semantic-release-npm-deprecate-old-versions":"^1.0.1","ts-jest":"^26.4.4","typedoc":"^0.19.2","typedoc-plugin-nojekyll":"^1.0.1"},"scripts":{"build":"echo 'Executing build' && yarn build:bundles && yarn build:docs","build:amd":"tsc -p ./tsconfig/amd.json","build:browser":"( test -d ./dist/esnext || yarn build:esnext ) && parcel build ./dist/esnext/index.js --target browser --out-dir ./dist/browser/ --global FunPromise --detailed-report 15","build:bundles":"./script/bootstrap && yarn build:dists && ./script/bundle-dists","build:cjs":"tsc -p ./tsconfig/cjs.json","build:dists":"rm -rf dist && yarn build:esnext && yarn build:es6 && yarn build:node && yarn build:react-native && yarn build:browser","build:docs":"rm -rf ./docs && mkdir ./docs && yarn build:docs:typedocs && yarn build:docs:changelog && yarn build:docs:test && yarn build:docs:coverage && mkdir -p ./dist && tar cJvf ./dist/docs.tar.xz ./docs","build:docs:changelog":"cp ./CHANGELOG.md ./docs/ || true","build:docs:coverage":"mkdir -p ./docs && npx browserslist --update-db && ( ( echo 'Explicitly Supported Browsers (MUST support Promises)' && npx browserslist && npx browserslist --coverage && npx browserslist --coverage=US && echo 'Note that functionally equivalent but unlisted browsers do not count in these stats, so real coverage is much higher than the percentages reported.' ) | tee ./docs/coverage.txt )","build:docs:test":"yarn test --verbose 2>&1 | tee ./docs/test-results.txt","build:docs:typedocs":"typedoc --tsconfig tsconfig.json --gitRevision \"$(git rev-parse --short HEAD)\"","build:es6":"yarn build:cjs && yarn build:esm && yarn build:umd && yarn build:amd","build:esm":"tsc -p ./tsconfig/esm.json","build:esnext":"tsc -p tsconfig.json","build:node":"yarn build:node:10 && yarn build:node:12 && yarn build:node:14","build:node:10":"tsc -p ./tsconfig/node10.json","build:node:12":"tsc -p ./tsconfig/node12.json","build:node:14":"tsc -p ./tsconfig/node14.json","build:react-native":"tsc -p ./tsconfig/react-native.json","build:umd":"tsc -p ./tsconfig/umd.json","bump-deps":"yarn upgrade -LCA && yarn install && yarn test","clean":"./script/clean","polish":"prettier --write .","prepack":"echo 'Executing prepack' && yarn build:bundles","serve:docs":"yarn build:docs && npx http-server ./docs","test":"jest --detectOpenHandles --forceExit ./*.test.js ./src/*.test.js","watch:compile":"tsc --watch -p tsconfig.json","watch:test":"yarn test --watch"},"husky":{"hooks":{"pre-commit":"lint-staged","pre-push":"yarn test && yarn build:esnext","prepare-commit-msg":"./script/has-message \"$1\" || ( exec < /dev/tty && git cz --hook )"}},"lint-staged":{"*.(js|cjs|mjs|json|yaml|yml|md|css|htm|htm|ts)":"prettier --write","*.json":"jq ."},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"sideEffects":false,"browserslist":["defaults, cover 95% and supports promises","not dead"],"gitHead":"b4ae6349195ef35d4d114e00827bcc4fea95f8cb","bugs":{"url":"https://github.com/RobertFischer/fun-promises/issues"},"_id":"fun-promises@2.1.0","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-wl8ecxipK8Ur6HTBaN0iJxRw/7Mw3iLXx5SpcYX2OO4A46pRGhlsfMPCojAdyeQhOyiJOLB6ZllNW28tTahSEA==","shasum":"8847ac7a415e955d49cef965f8b242f466fb9e5c","tarball":"https://registry.npmjs.org/fun-promises/-/fun-promises-2.1.0.tgz","fileCount":122,"unpackedSize":1122519,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf19u9CRA9TVsSAnZWagAAdUsP/2rAoEg1hh2JFjvB0KlL\ncN3l3GeI+Mb0pEY37IGIfcaSoeUqf4T3ziTE//5AWtlAAZ/1pXQkLPkRhLyg\nMbQs4a/YX4AX/7OC4l3FVokumPVCTX4pqlAQ0qkfP0P8OqmJ7hyPxyZjcHdS\nO7grzOAE0jctkkJfSckaatwRSHhfLQzISP7cbAy/V4mDjRHH6cKFVsWIonPc\nZP9o4J+7Dp2Tx+L1r8sxpe9/Jx+rbsZKrZGPvqCAXK5gmhSMwg9WgvbYKNe7\nGxL2s25r5xXg5WZYfjEqFtoOpABY1n/LZZCdPySvSX5+GMlyOcuKJAagb/zD\nrvzPLSm3G8zFudbFMX1P3iLyit0XiNnre+FMU/TYUS50SymzZjGNdKg16bkB\nJ+tBJNBaYwaNZNqTCTwe7gtfhA1/7+O8sxuPIJs4+GViOsyPgJlQZGcPZ7Xz\ncUomGLYdb7bSOFf+BNVDeKKhKXuY78oSj0ztxw3ike89pf2Nnk7OGfp4ahM2\nXIaLM0dRZeeKzXXPlKU+OtZ7MlxLtPEX17a5c5mk/LMnpiUIaXlg/4zI3b+j\nlzBj0SJ1fsSg3YHhNrY9OzPTdLg4+5Pgm9IAz8omadiYDVul71R0mhA1mMM8\nrQTfgEa4ar+6IeP29DAJd2GBRsP2dh7rqxLZC4BZ2fxaEs7T4lEfwC/Ycz8W\nfDrM\r\n=8cYB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLE09QOKjXI563TeRk9KwZuY5tMLcF3DwQZV/GSisHSAIhAKx6CEE/1sBa5/mDqaIb489iVXI7fz6E8nOr0dkECsyf"}]},"_npmUser":{"name":"robertfischer","email":"smokejumperit@gmail.com"},"directories":{},"maintainers":[{"name":"robertfischer","email":"smokejumperit@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fun-promises_2.1.0_1607982013478_0.3896985540406128"},"_hasShrinkwrap":false}},"time":{"created":"2020-11-30T14:37:36.190Z","1.1.0-alpha.1":"2020-11-30T14:37:36.447Z","modified":"2022-05-03T00:43:41.101Z","1.1.0-rc.2":"2020-12-02T16:47:07.192Z","1.2.0-rc.1":"2020-12-02T17:25:36.512Z","1.2.0-rc.2":"2020-12-02T18:54:57.064Z","1.2.0":"2020-12-03T17:50:19.125Z","1.4.0-rc.1":"2020-12-05T00:48:30.595Z","1.4.0":"2020-12-05T00:51:13.190Z","1.4.0-rc.2":"2020-12-05T20:55:59.165Z","1.5.0":"2020-12-05T21:40:05.341Z","1.6.0-rc.1":"2020-12-06T22:55:56.671Z","1.6.0":"2020-12-08T15:28:50.109Z","2.0.0-rc.1":"2020-12-09T16:49:18.552Z","2.0.0-rc.2":"2020-12-10T03:07:58.978Z","2.0.0":"2020-12-10T03:29:50.188Z","2.0.1-rc.1":"2020-12-10T19:35:23.129Z","2.0.1-rc.2":"2020-12-10T21:55:27.459Z","2.0.1-rc.3":"2020-12-11T00:47:59.526Z","2.0.2":"2020-12-11T18:11:15.971Z","2.1.0-rc.1":"2020-12-13T17:49:04.587Z","2.1.0-rc.2":"2020-12-14T21:36:22.856Z","2.1.0":"2020-12-14T21:40:13.675Z"},"maintainers":[{"name":"robertfischer","email":"smokejumperit@gmail.com"}],"description":"A library for making Promises more friendly, fluent, and fun(ctional).","homepage":"https://robertfischer.github.io/fun-promises/","keywords":["async","asyncawait","await","bluebird","concurrency","concurrently","deferred","deferreds","flow control","functional programming","functional","future","futures","map","mapper","parallel","promise","promises","promises-a","promises-aplus","typescript"],"repository":{"type":"git","url":"git+ssh://git@github.com/RobertFischer/fun-promises.git"},"author":{"name":"Robert Fischer"},"license":"Unlicense","readme":"<!-- @format -->\n\n# fun-promises\n\n**A library for making Promises more friendly, fluent, and fun(ctional).**\n\n## Install\n\n### Yarn\n\n```\nyarn add fun-promises\n```\n\n### npm\n\n```\nnpm install --save fun-promises\n```\n\n### CDN for Browsers\n\nThe following URL contains a script which will set the `FunPromises` global to\nbe an object containing the various exports of\n[`index.ts`](https://robertfischer.github.io/fun-promises/modules/_index_.html).\n\n```\nhttps://unpkg.com/browse/fun-promises@latest/dist/browser/index.js\n```\n\n## Usage\n\n### ES Modules\n\n```\nimport FunPromise from \"fun-promises\";\n```\n\n### CJS\n\n```\nconst { FunPromise } = require(\"fun-promises\");\n```\n\n## What This Is Not\n\nThis is _not_ an implementation of [Promises/A+](https://promisesaplus.com/). It\nis not a polyfill or a [ponyfill](https://github.com/sindresorhus/ponyfill). In\nfact, it assumes that you have `Promise` available as a global, either through a\npolyfill or natively.\n\n## What This Is\n\nThis is a library that extends the native `Promise` implementation with a number\nof useful utilities, so that your code is faster and easier. It is inspired by\nlibraries like [`bluebird`](http://bluebirdjs.com/) and\n[`rsvp.js`](https://github.com/tildeio/rsvp.js/blob/master/README.md), except\nwithout the overhead of providing its own `Promise` implementation. Native\npromises have been competitive in performance since Node 10\n([even `bluebird` says so](https://www.npmjs.com/package/bluebird#note)) but\nthere's a lot of functionality which native `Promises` don't supply. Fun\nPromises gives you that better API without the overhead.\n\n## API\n\n- [FunPromise](http://robertfischer.github.io/fun-promises/classes/_src_fun_promise_.funpromise.html)\n- [Deferral](http://robertfischer.github.io/fun-promises/modules/_src_deferral_.deferral.html)\n- [Types](http://robertfischer.github.io/fun-promises/modules/_src_types_.html)\n\nYou also may want to check out\n[the BDD spec](http://robertfischer.github.io/fun-promises/test-results.txt),\nwhich gives an overview of how we expect these things to work.\n\n## Some Highlights\n\n### `settle` / `settleAll`\n\nThis changes a promise of a value into a promise of an object describing the\nresult. The finally resolved object has a `status` property that is either\n`\"fulfilled\"` or `\"rejected\"`, and also provides access to the reason or value.\n\n### `Deferral` class\n\nThis is an inside-out promise: it gives you access to the `resolve` and `reject`\nmethods of the promise so that you can perform operations on them later, as well\nas having accessor to query the state of `promise`.\n\n### `try`\n\n```typescript\nFunPromise.try(() => doSomething(explosivelyFailingParamCalculation()));\nFunPromise.try(async () => {\n\t/* do stuff */ await something; /* do more stuff */\n});\n```\n\nWrap your execution in a promise, so that even its invocation\n[won't release Zalgo](https://blog.izs.me/2013/08/designing-apis-for-asynchrony),\nor as a convinent way to build a `FunPromise` off of an `async` function.\n\n### `tap`\n\n```typescript\nsomeExpensiveOperation()\n\t.tap((value) => debug(\"Value from someExpensiveOperation\", value))\n\t.then(/* ... */);\n```\n\nThis lets you take a look at a resolved value without risking changing it. This\nis extremely useful for debugging log messages.\n\n### `race`\n\n```typescript\ngetRelatedShows().race((someShow) => renderSuggestedShow(someShow));\n```\n\nFire off a bunch of promises and return whichever one resolves first. (The\nresults of any later-resolving promises are discarded.)\n\n### `coalesce`\n\n```typescript\nFunPromise.coalesce([\n\tlookupUserInMemoryCache,\n\tlookupUserInRedisCache,\n\tlookupUserInDB,\n]).then((data) => renderUserData(data));\n```\n\nGiven a bunch of functions that return either values or promises of values,\nexecute them sequentially and return the first one what resolves.\n\n### Types\n\nThere are types that represent unwrapped promise values\n([`Unpromise`](https://robertfischer.github.io/fun-promises/modules/_src_types_.html#unpromise)),\nthings that may be promises or values\n([`Promisable`](https://robertfischer.github.io/fun-promises/modules/_src_types_.html#promisable)),\nand\n[a few others that are a lot more esoteric](https://robertfischer.github.io/fun-promises/modules/_src_types_.html).\n\n_NOTE_: Compiling these types requires a recent version of TypeScript (4.1 or\ngreater) due to conditional recursive types being unavailable in 3.x and buggy\nin 4.0.x.\n\n## Distributions\n\nBy default, your packager should automatically grab the appropriate distribution\nthrough the `package.json` configuration within this library. If you're curious\nor if you have a weird use case, then each distribution has a few different\nflavors of the codebase to choose from. These all live under the `./dist`\ndirectory.\n\n### ESNext\n\nWithin `./dist/esnext` is the result of the Typescript compilation with the\n[\"ESNext\" `module` setting](https://www.typescriptlang.org/tsconfig#module) and\nthe [\"ESNext\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\nNote that it is subject to change as new ECMAScript standards are put out and\nTypescript's JavaScript generation continues to catch up to them, and mostly\nexists for developers to see code that results from compilation.\n\n### ES6\n\nWithin `./dist/es6` are the folders `amd`, `umd`, `cjs` (CommonJS), and `esm`\n(ECMAScript Modules). These contain the result of the Typescript compilation\nwith the corresponding\n[`module` setting](https://www.typescriptlang.org/tsconfig#module) and the\n[\"ES6\" `target` setting](https://www.typescriptlang.org/tsconfig#target).\n\nThe only single-file distribution is the `es6/amd` distribution.\n\n### Node\n\nWithin `./dist/node` are the folders `v10`, `v12`, `v14`, each of which\ncontaining the Typescript compilation based on\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#node-10-tsconfigjson).\nfor those environments. All the versions are the exact same code as of this\nwriting, so we default Node to using `node/v14`.\n\n### Browser\n\nThe file at `./dist/browser/index.js` is the result of transpiling the result of\nthe `ESNext` code above using [Parcel](http://parceljs.org/). The result is a\nsingle minified file, appropriate for use in a CDN. It exposes the module under\nthe global `FunPromise` namespace.\n\n### React Native\n\nWithin `./dist/react-native` is the result of transpiling the result with\n[the recommended `tsconfig.json` configs](https://github.com/tsconfig/bases#react-native-tsconfigjson)\nfor React Native. The distribution is specified in `package.json` under the\n`\"reactNative\"` key,\n[which you can configure Metro to prefer](https://facebook.github.io/metro/docs/configuration/#resolvermainfields).\n\n## Documentation\n\nThe full documentation (including this content) is available on\n[GitHub Pages](https://robertfischer.github.io/fun-promises/).\n\n### Specifications\n\nOur test specs are\n[published here](https://robertfischer.github.io/fun-promises/test-results.txt).\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/RobertFischer/fun-promises/issues"}}