| import toIter from "./toIter"; | ||
| import call from "./call"; | ||
| import first from "./first"; | ||
| import nop from "./nop"; | ||
| import takeFirst from "./takeFirst"; | ||
@@ -17,4 +18,4 @@ import isPromise from "./isPromise"; | ||
| while (!(cur = iter.next()).done) { | ||
| acc = isPromise(acc) | ||
| ? acc.then(a => f(acc, a), e => e == nop ? acc : Promise.reject(e)) | ||
| acc = isPromise(cur.value) | ||
| ? cur.value.then(a => f(acc, a), e => e == nop ? acc : Promise.reject(e)) | ||
| : f(acc, cur.value); | ||
@@ -21,0 +22,0 @@ |
+7
-1
| import curry from "../general/curry"; | ||
| import call from "../general/call"; | ||
| import isPromise from "../general/isPromise"; | ||
| import nop from "../general/nop"; | ||
| export default curry(function *filterL(f, iter) { | ||
| for (const a of iter) if(call(a, f)) yield a; | ||
| for (const a of toIter(iter)) { | ||
| const b = call(a, f); | ||
| if(isPromise(b)) yield b.then(b => b ? a : Promise.reject(nop)); | ||
| else yield a; | ||
| } | ||
| }); |
+2
-1
| import curry from "../general/curry"; | ||
| import call from "../general/call"; | ||
| import toIter from "../general/toIter"; | ||
| export default curry(function *mapL(f, iter) { | ||
| for (const a of iter) yield call(a, f); | ||
| for (const a of toIter(iter)) yield call(a, f); | ||
| }); |
+1
-1
| { | ||
| "name": "fff-js", | ||
| "version": "0.0.7", | ||
| "version": "0.0.8", | ||
| "description": "Functional javascript lib", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
16088
1.7%382
2.14%