-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pipe): add piped operators [WIP - DO NOT MERGE] (#75)
* feat(pipe): add piped operators * feat(pipe): add through concat * feat(pipe): add through defaultIfEmpty * feat(pipe): add through delay * feat(pipe): add through delayEach * feat(pipe): add through distinct * feat(pipe): add through distinctUntilChanged * feat(pipe): add through doWhile * feat(pipe): add through endwith * feat(pipe): add through except * feat(pipe): add through expand * feat(pipe): add through filter * feat(pipe): add through finally * feat(pipe): add through flatmap * feat(pipe): add through flatten * feat(pipe): add through groupby * feat(pipe): add through groupjoin * feat(pipe): add through ignoreelements * feat(pipe): add through innerjoin * feat(pipe): add through intersect * feat(pipe): add through map * feat(pipe): add through memoize * feat(pipe): add through merge * feat(pipe): add through mergeAll * feat(pipe): add through minby * feat(pipe): add through onerrorresumenext * feat(pipe): add through pairwise * feat(pipe): add through pluck * feat(pipe): add through publish * feat(pipe): add through repeat * feat(pipe): add through retry * feat(pipe): add through reverse * feat(pipe): add through scan * feat(pipe): add through scanRight * feat(pipe): add through share * feat(pipe): add through skip * feat(pipe): add through skipLast * feat(pipe): add through skipUntil * feat(pipe): add through skipWhile * feat(pipe): add through slice * feat(pipe): add through startwith * feat(pipe): add through take * feat(pipe): add through takelast * feat(pipe): add through takeuntil * feat(pipe): add through takewhile * feat(pipe): add through tap * feat(pipe): add through throttle * feat(pipe): add through timeinterval * feat(pipe): add through timeout * feat(pipe): add through timestamp * feat(pipe): add through union * feat(pipe): add through buffer * feat(pipe): add through catch * feat(pipe): add through catchWith * feat(pipe): add through concat * feat(pipe): add through concatall * feat(pipe): add through defaultifempty * feat(pipe): add through distinct * feat(pipe): add through distinctuntilchanged * feat(pipe): add through dowhile * feat(pipe): add through endwith * feat(pipe): add through except * feat(pipe): add through expand * feat(pipe): add through filter * feat(pipe): add through finally * feat(pipe): add through flatmap * feat(pipe): add through flatten * feat(pipe): add through groupjoin * feat(pipe): add through ignorelements * feat(pipe): add through innerjoin * feat(pipe): add through intersect * feat(pipe): add through map * feat(pipe): add through maxby * feat(pipe): add through memoie * feat(pipe): add through minby * feat(pipe): add through onerrorresumenext * feat(pipe): add through pairwise * feat(pipe): add through pluck * feat(pipe): add through publish * feat(pipe): add through repeat * feat(pipe): add through retry * feat(pipe): add through reverse * feat(pipe): add through scan * feat(pipe): add through scanright * feat(pipe): add through share * feat(pipe): add through skip * feat(pipe): add through skiplast * feat(pipe): add through skipwhile * feat(pipe): add through slice * feat(pipe): add through startwith * feat(pipe): add through take * feat(pipe): add through takelast * feat(pipe): add through takewhile * feat(pipe): add through tap * feat(pipe): add through union * feat(pipe): add through pipe * feat(pipe): moving pipe and forEach to core * feat(pipe): adds of and from to base * feat(pipe): fix build * style(lint): update code lint friendly (#116) * feat(from): make from on non-iterables coerce to iterables (#117) * feat(pipe): add to __modules * feat(pipe): add to __modules * feat(pipe): adding piped tests * fix pipe exports (#119) * build(gulpfile): allow building UMD intermediate step standalone for debugging * fix(ix): declare prototype pipe method type so it isn't minified away * fix(pipe): export pipe operators separately so they're not minified away * test(operators): add helper to test all three operator variants * fix(reduce): fix scan/reduce proto method argument checks * test(spec): execute iterable operator tests on all operator variants * test(spec): execute asynciterable operator tests on all operator variants * fix(ix): export OrderedIterableBase so thenBy method names are protected from Uglify * chore(lint): fix lint * test(helpers): disable missing pipe fn logging
- Loading branch information
1 parent
0cce755
commit 76a4b4f
Showing
376 changed files
with
4,055 additions
and
2,049 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,8 @@ | |
"release": "./npm-release.sh", | ||
"doc": "shx rm -rf ./doc && esdoc", | ||
"commitmsg": "validate-commit-msg", | ||
"lint:src": "tslint --fix --type-check -p tsconfig.json -c tslint.json \"src/**/*.ts\"", | ||
"lint:spec": "tslint --fix --type-check -p spec/tsconfig.json -c tslint.json \"spec/**/*.ts\"", | ||
"lint:src": "tslint --fix --project -p tsconfig.json -c tslint.json \"src/**/*.ts\"", | ||
"lint:spec": "tslint --fix --project -p spec/tsconfig.json -c tslint.json \"spec/**/*.ts\"", | ||
"prepublishOnly": "echo \"Error: do 'npm run release' instead of 'npm publish'\" && exit 1" | ||
}, | ||
"author": "Matthew Podwysocki <[email protected]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,30 @@ | ||
import * as Ix from '../Ix'; | ||
import * as test from 'tape-async'; | ||
const { catchWith } = Ix.asynciterable; | ||
const { of } = Ix.asynciterable; | ||
import { testOperator } from '../asynciterablehelpers'; | ||
const test = testOperator([Ix.asynciterable.catchWith]); | ||
const { of } = Ix.AsyncIterable; | ||
const { range } = Ix.asynciterable; | ||
const { sequenceEqual } = Ix.asynciterable; | ||
const { single } = Ix.asynciterable; | ||
const { _throw } = Ix.asynciterable; | ||
|
||
test('AsyncIterable#catchWith error catches', async t => { | ||
test('AsyncIterable#catchWith error catches', async (t, [catchWith]) => { | ||
const err = new Error(); | ||
const res = await single(catchWith(_throw(err), async e => { t.same(err, e); return of(42); })); | ||
const res = await single( | ||
catchWith(_throw(err), async e => { | ||
t.same(err, e); | ||
return of(42); | ||
}) | ||
); | ||
t.equal(42, res); | ||
t.end(); | ||
}); | ||
|
||
test('AsyncIterable#catchWith no error misses', async t => { | ||
test('AsyncIterable#catchWith no error misses', async (t, [catchWith]) => { | ||
const xs = range(0, 10); | ||
const res = catchWith(xs, async e => { t.fail(); return of(42); }); | ||
const res = catchWith(xs, async e => { | ||
t.fail(); | ||
return of(42); | ||
}); | ||
t.true(await sequenceEqual(res, xs)); | ||
t.end(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.