Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
FxJS is a functional programming library that uses basic JavaScript values and emphasizes repeatable programming and Promise.
const res = go(
L.range(Infinity),
L.filter(a => a % 2),
L.take(3),
reduce(add));
log(res); // 9
go(
L.range(Infinity),
L.map(delay(1000)),
L.map(a => a + 10),
L.take(3),
each(log));
// After 1 second 10
// After 2 seconds 11
// After 3 seconds 12
// L.interval = time => L.map(delay(time), L.range(Infinity));
(async () => {
await go(
L.interval(1000),
L.map(a => a + 30),
L.takeUntil(a => a == 33),
each(log));
// After 1 second 30
// After 2 seconds 31
// After 3 seconds 32
// After 4 seconds 33
const res = await go(
L.interval(1000),
L.map(a => a + 20),
L.takeWhile(a => a < 23),
L.map(tap(log)),
reduce(add));
// After 5 seconds 20
// After 6 seconds 21
// After 7 seconds 22
log(res);
// 63
} ());
npm i fxjs2
map(a => a + 10, [1, 2, 3]);
// [11, 12, 13]
filter(a => a % 2, [1, 2, 3]);
// [1, 3]
const add = (a, b) => a + b
reduce(add, [1, 2, 3]);
// 6
reduce(add, 10, [1, 2, 3]);
// 16
reduce(add, {a: 1, b: 2, c: 3});
// 6
await reduce(add, [Promise.resolve(1), 2, 3])
// 6
take(1, [1, 2, 3]);
// [1]
take(2, [1, 2, 3])
// [1, 2]
const iterator = L.map(a => a + 10, [1, 2, 3]);
take(2, iterator);
// [11, 12]
const iterator = L.filter(a => a % 2, [1, 2, 3, 4, 5]);
take(2, iterator);
// [1, 3]
const iterator = L.filter(a => a % 2, L.map(a => a + 10, [1, 2, 3, 4, 5]));
take(2, iterator);
// [11, 13]
const b = go(
0,
a => a + 1,
a => a + 10,
a => a + 100);
console.log(b);
// 111
try {
const b = go(
0,
a => { throw { hi: 'ho' } },
a => a + 10,
a => a + 100);
console.log(b);
} catch (c) {
console.log(c);
}
// { hi: 'ho' }
const b = await go(
0,
a => Promise.resolve(a + 1),
a => a + 10,
a => a + 100);
console.log(b);
// 111
try {
const b = await go(
0,
a => Promise.resolve(a + 1),
a => Promise.reject({ hi: 'ho' }),
a => a + 100);
console.log(b);
} catch (c) {
console.log(c);
}
// { hi: 'ho' }
try {
const b = await go(
0,
a => Promise.resolve(a + 1),
a => Promise.reject({ hi: 'ho' }),
a => a + 100);
console.log(b);
} catch (c) {
console.log(c);
}
// { hi: 'ho' }
const f1 = pipeS(
a => a % 2 ? stop(a) : a,
a => a + 10);
f1(1); // 1
f1(2); // 12
goS({a: 1, b: 2},
stopIf({a: 1}),
({a, b}) => ({a: a + 10, b})); // {a: 1, b: 2}
goS({a: 2, b: 2},
stopIf({a: 1}),
({a, b}) => ({a: a + 10, b})); // {a: 12, b: 2}
goS({a: 1, b: 2},
stopIf({a: 1}, null),
({a, b}) => ({a: a + 10, b}));
// null
FAQs
Functional Extensions for modern Javascript
The npm package fxjs2 receives a total of 0 weekly downloads. As such, fxjs2 popularity was classified as not popular.
We found that fxjs2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.