🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

fff-js

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fff-js - npm Package Compare versions

Comparing version
0.0.7
to
0.0.8
+3
-2
general/reduce.js
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;
}
});
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);
});
{
"name": "fff-js",
"version": "0.0.7",
"version": "0.0.8",
"description": "Functional javascript lib",

@@ -5,0 +5,0 @@ "main": "index.js",