diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-05-28 00:38:50 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-05-28 00:40:43 +0200 |
commit | 7fff4499fd915bcea3fa93b1aa8b35f4fe7a6027 (patch) | |
tree | 6de9a1aebd150a23b7f8c273ec657a5d0a18fe3e /node_modules/observable-to-promise | |
parent | 963b7a41feb29cc4be090a2446bdfe0c1f1bcd81 (diff) | |
download | wallet-core-7fff4499fd915bcea3fa93b1aa8b35f4fe7a6027.tar.xz |
add linting (and some initial fixes)
Diffstat (limited to 'node_modules/observable-to-promise')
14 files changed, 413 insertions, 0 deletions
diff --git a/node_modules/observable-to-promise/index.js b/node_modules/observable-to-promise/index.js new file mode 100644 index 000000000..7109b70e5 --- /dev/null +++ b/node_modules/observable-to-promise/index.js @@ -0,0 +1,23 @@ +'use strict'; +const isObservable = require('is-observable'); +const symbolObservable = require('symbol-observable').default; + +module.exports = val => { + if (!isObservable(val)) { + throw new TypeError('Expected an Observable'); + } + + const ret = []; + + return new Promise((resolve, reject) => { + val[symbolObservable]().subscribe({ + next: x => { + ret.push(x); + }, + error: reject, + complete: () => { + resolve(ret); + } + }); + }); +}; diff --git a/node_modules/observable-to-promise/license b/node_modules/observable-to-promise/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/observable-to-promise/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/observable-to-promise/node_modules/symbol-observable/CHANGELOG.md b/node_modules/observable-to-promise/node_modules/symbol-observable/CHANGELOG.md new file mode 100644 index 000000000..264fbaefa --- /dev/null +++ b/node_modules/observable-to-promise/node_modules/symbol-observable/CHANGELOG.md @@ -0,0 +1,104 @@ +<a name="1.0.4"></a> +## [1.0.4](https://github.com/blesh/symbol-observable/compare/1.0.3...v1.0.4) (2016-10-13) + + +### Bug Fixes + +* **global:** global variable location no longer assumes `module` exists ([4f85ede](https://github.com/blesh/symbol-observable/commit/4f85ede)), closes [#24](https://github.com/blesh/symbol-observable/issues/24) + + + +<a name="1.0.3"></a> +## [1.0.3](https://github.com/blesh/symbol-observable/compare/1.0.2...v1.0.3) (2016-10-11) + + +### Bug Fixes + +* **mozilla addons support:** fix obtaining global object (#23) ([38da34d](https://github.com/blesh/symbol-observable/commit/38da34d)), closes [#23](https://github.com/blesh/symbol-observable/issues/23) + + + +<a name="1.0.2"></a> +## [1.0.2](https://github.com/blesh/symbol-observable/compare/1.0.1...v1.0.2) (2016-08-09) + +### Bug Fixes + +* **ECMAScript 3**: ensure output is ES3 compatible ([3f37af3](https://github.com/blesh/symbol-observable/commit/3f37af3)) + + + +<a name="1.0.1"></a> +## [1.0.1](https://github.com/blesh/symbol-observable/compare/1.0.0...v1.0.1) (2016-06-15) + + +### Bug Fixes + +* **bundlers:** fix issue that caused some bundlers not to be able to locate `/lib` (#19) ([dd8fdfe](https://github.com/blesh/symbol-observable/commit/dd8fdfe)), closes [(#19](https://github.com/(/issues/19) [#17](https://github.com/blesh/symbol-observable/issues/17) + + + +<a name="1.0.0"></a> +# [1.0.0](https://github.com/blesh/symbol-observable/compare/0.2.4...v1.0.0) (2016-06-13) + + +### Bug Fixes + +* **index.js:** use typeof to check for global or window definitions (#8) ([5f4c2c6](https://github.com/blesh/symbol-observable/commit/5f4c2c6)) +* **types:** use default syntax for typedef ([240e3a6](https://github.com/blesh/symbol-observable/commit/240e3a6)) +* **TypeScript:** exported ponyfill now works with TypeScript ([c0b894e](https://github.com/blesh/symbol-observable/commit/c0b894e)) + +### Features + +* **es2015:** add es2015 implementation to support rollup (#10) ([7a41de9](https://github.com/blesh/symbol-observable/commit/7a41de9)) + + +### BREAKING CHANGES + +* TypeScript: CJS users will now have to `require('symbol-observable').default` rather than just `require('symbol-observable')` this was done to better support ES6 module bundlers. + + + +<a name="0.2.4"></a> +## [0.2.4](https://github.com/blesh/symbol-observable/compare/0.2.2...v0.2.4) (2016-04-25) + + +### Bug Fixes + +* **IE8 support:** Ensure ES3 support so IE8 is happy ([9aaa7c3](https://github.com/blesh/symbol-observable/commit/9aaa7c3)) +* **Symbol.observable:** should NOT equal `Symbol.for('observable')`. ([3b0fdee](https://github.com/blesh/symbol-observable/commit/3b0fdee)), closes [#7](https://github.com/blesh/symbol-observable/issues/7) + + + +<a name="0.2.3"></a> +## [0.2.3](https://github.com/blesh/symbol-observable/compare/0.2.3...v0.2.3) (2016-04-24) + +### Bug Fixes + +- **IE8/ECMAScript 3**: Make sure legacy browsers don't choke on a property named `for`. ([9aaa7c](https://github.com/blesh/symbol-observable/9aaa7c)) + + +<a name="0.2.2"></a> +## [0.2.2](https://github.com/sindresorhus/symbol-observable/compare/0.2.1...v0.2.2) (2016-04-19) + +### Features + +* **TypeScript:** add TypeScript typings file ([befd7a](https://github.com/sindresorhus/symbol-observable/commit/befd7a)) + + +<a name="0.2.1"></a> +## [0.2.1](https://github.com/sindresorhus/symbol-observable/compare/0.2.0...v0.2.1) (2016-04-19) + + +### Bug Fixes + +* **publish:** publish all required files ([5f26c3a](https://github.com/sindresorhus/symbol-observable/commit/5f26c3a)) + + + +<a name="0.2.0"></a> +# [0.2.0](https://github.com/sindresorhus/symbol-observable/compare/v0.1.0...v0.2.0) (2016-04-19) + + +### Bug Fixes + +* **Symbol.observable:** ensure Symbol.for(\'observable\') matches Symbol.observable ([ada343f](https://github.com/sindresorhus/symbol-observable/commit/ada343f)), closes [#1](https://github.com/sindresorhus/symbol-observable/issues/1) [#2](https://github.com/sindresorhus/symbol-observable/issues/2) diff --git a/node_modules/observable-to-promise/node_modules/symbol-observable/es/index.js b/node_modules/observable-to-promise/node_modules/symbol-observable/es/index.js new file mode 100644 index 000000000..c1877552c --- /dev/null +++ b/node_modules/observable-to-promise/node_modules/symbol-observable/es/index.js @@ -0,0 +1,19 @@ +/* global window */ +import ponyfill from './ponyfill'; + +var root; + +if (typeof self !== 'undefined') { + root = self; +} else if (typeof window !== 'undefined') { + root = window; +} else if (typeof global !== 'undefined') { + root = global; +} else if (typeof module !== 'undefined') { + root = module; +} else { + root = Function('return this')(); +} + +var result = ponyfill(root); +export default result; diff --git a/node_modules/observable-to-promise/node_modules/symbol-observable/es/ponyfill.js b/node_modules/observable-to-promise/node_modules/symbol-observable/es/ponyfill.js new file mode 100644 index 000000000..95dedc2e5 --- /dev/null +++ b/node_modules/observable-to-promise/node_modules/symbol-observable/es/ponyfill.js @@ -0,0 +1,17 @@ +export default function symbolObservablePonyfill(root) { + var result; + var Symbol = root.Symbol; + + if (typeof Symbol === 'function') { + if (Symbol.observable) { + result = Symbol.observable; + } else { + result = Symbol('observable'); + Symbol.observable = result; + } + } else { + result = '@@observable'; + } + + return result; +}; diff --git a/node_modules/observable-to-promise/node_modules/symbol-observable/index.d.ts b/node_modules/observable-to-promise/node_modules/symbol-observable/index.d.ts new file mode 100644 index 000000000..6816a1d6b --- /dev/null +++ b/node_modules/observable-to-promise/node_modules/symbol-observable/index.d.ts @@ -0,0 +1,2 @@ +declare const observableSymbol: symbol; +export default observableSymbol; diff --git a/node_modules/observable-to-promise/node_modules/symbol-observable/index.js b/node_modules/observable-to-promise/node_modules/symbol-observable/index.js new file mode 100644 index 000000000..b58e228f6 --- /dev/null +++ b/node_modules/observable-to-promise/node_modules/symbol-observable/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/index'); diff --git a/node_modules/observable-to-promise/node_modules/symbol-observable/lib/index.js b/node_modules/observable-to-promise/node_modules/symbol-observable/lib/index.js new file mode 100644 index 000000000..174918f04 --- /dev/null +++ b/node_modules/observable-to-promise/node_modules/symbol-observable/lib/index.js @@ -0,0 +1,29 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _ponyfill = require('./ponyfill'); + +var _ponyfill2 = _interopRequireDefault(_ponyfill); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +var root; /* global window */ + + +if (typeof self !== 'undefined') { + root = self; +} else if (typeof window !== 'undefined') { + root = window; +} else if (typeof global !== 'undefined') { + root = global; +} else if (typeof module !== 'undefined') { + root = module; +} else { + root = Function('return this')(); +} + +var result = (0, _ponyfill2['default'])(root); +exports['default'] = result;
\ No newline at end of file diff --git a/node_modules/observable-to-promise/node_modules/symbol-observable/lib/ponyfill.js b/node_modules/observable-to-promise/node_modules/symbol-observable/lib/ponyfill.js new file mode 100644 index 000000000..be68acaad --- /dev/null +++ b/node_modules/observable-to-promise/node_modules/symbol-observable/lib/ponyfill.js @@ -0,0 +1,23 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports['default'] = symbolObservablePonyfill; +function symbolObservablePonyfill(root) { + var result; + var _Symbol = root.Symbol; + + if (typeof _Symbol === 'function') { + if (_Symbol.observable) { + result = _Symbol.observable; + } else { + result = _Symbol('observable'); + _Symbol.observable = result; + } + } else { + result = '@@observable'; + } + + return result; +};
\ No newline at end of file diff --git a/node_modules/observable-to-promise/node_modules/symbol-observable/license b/node_modules/observable-to-promise/node_modules/symbol-observable/license new file mode 100644 index 000000000..0239f4730 --- /dev/null +++ b/node_modules/observable-to-promise/node_modules/symbol-observable/license @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) +Copyright (c) Ben Lesh <ben@benlesh.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/observable-to-promise/node_modules/symbol-observable/package.json b/node_modules/observable-to-promise/node_modules/symbol-observable/package.json new file mode 100644 index 000000000..b938f69ad --- /dev/null +++ b/node_modules/observable-to-promise/node_modules/symbol-observable/package.json @@ -0,0 +1,47 @@ +{ + "name": "symbol-observable", + "version": "1.0.4", + "description": "Symbol.observable ponyfill", + "license": "MIT", + "repository": "blesh/symbol-observable", + "author": { + "name": "Ben Lesh", + "email": "ben@benlesh.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "npm run build && mocha && tsc ./ts-test/test.ts && node ./ts-test/test.js && check-es3-syntax -p lib/ --kill", + "build": "babel es --out-dir lib", + "prepublish": "npm test" + }, + "files": [ + "index.js", + "ponyfill.js", + "index.d.ts", + "es/index.js", + "es/ponyfill/js", + "lib/index.js", + "lib/ponyfill.js" + ], + "jsnext:main": "es/index.js", + "typings": "index.d.ts", + "keywords": [ + "symbol", + "observable", + "observables", + "ponyfill", + "polyfill", + "shim" + ], + "devDependencies": { + "babel-cli": "^6.9.0", + "babel-preset-es2015": "^6.9.0", + "babel-preset-es3": "^1.0.0", + "chai": "^3.5.0", + "check-es3-syntax-cli": "^0.1.0", + "mocha": "^2.4.5", + "typescript": "^1.8.10" + } +} diff --git a/node_modules/observable-to-promise/node_modules/symbol-observable/readme.md b/node_modules/observable-to-promise/node_modules/symbol-observable/readme.md new file mode 100644 index 000000000..99bb9a066 --- /dev/null +++ b/node_modules/observable-to-promise/node_modules/symbol-observable/readme.md @@ -0,0 +1,31 @@ +# symbol-observable [![Build Status](https://travis-ci.org/blesh/symbol-observable.svg?branch=master)](https://travis-ci.org/blesh/symbol-observable) + +> [`Symbol.observable`](https://github.com/zenparsing/es-observable) [ponyfill](https://ponyfill.com) + + +## Install + +``` +$ npm install --save symbol-observable +``` + + +## Usage + +```js +const symbolObservable = require('symbol-observable'); + +console.log(symbolObservable); +//=> Symbol(observable) +``` + + +## Related + +- [is-observable](https://github.com/sindresorhus/is-observable) - Check if a value is an Observable +- [observable-to-promise](https://github.com/sindresorhus/observable-to-promise) - Convert an Observable to a Promise + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/observable-to-promise/package.json b/node_modules/observable-to-promise/package.json new file mode 100644 index 000000000..a88ecc19c --- /dev/null +++ b/node_modules/observable-to-promise/package.json @@ -0,0 +1,42 @@ +{ + "name": "observable-to-promise", + "version": "0.5.0", + "description": "Convert an Observable to a Promise", + "license": "MIT", + "repository": "sindresorhus/observable-to-promise", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "observable", + "observables", + "promise", + "promises", + "convert", + "subscribe" + ], + "dependencies": { + "is-observable": "^0.2.0", + "symbol-observable": "^1.0.4" + }, + "devDependencies": { + "ava": "*", + "most": "^1.2.2", + "p-is-promise": "^1.1.0", + "rxjs": "^5.2.0", + "xo": "*", + "xstream": "^10.2.0", + "zen-observable": "^0.5.0" + } +} diff --git a/node_modules/observable-to-promise/readme.md b/node_modules/observable-to-promise/readme.md new file mode 100644 index 000000000..2d4467b2c --- /dev/null +++ b/node_modules/observable-to-promise/readme.md @@ -0,0 +1,32 @@ +# observable-to-promise [![Build Status](https://travis-ci.org/sindresorhus/observable-to-promise.svg?branch=master)](https://travis-ci.org/sindresorhus/observable-to-promise) + +> Convert an [Observable](https://github.com/tc39/proposal-observable) to a Promise + + +## Install + +``` +$ npm install --save observable-to-promise +``` + + +## Usage + +```js +const observableToPromise = require('observable-to-promise'); + +observableToPromise(Observable.of(1, 2)).then(result => { + console.log(result); + //=> [1, 2] +}); +``` + + +## Related + +- [is-observable](https://github.com/sindresorhus/is-observable) - Check if a value is an Observable + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) |