Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fxjs2

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fxjs2 - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

22

fx.js

@@ -1,2 +0,2 @@

// FxJS 0.0.9
// FxJS 0.0.10
export const

@@ -141,2 +141,4 @@ identity = a => a,

hi = tap(log),
each = curry((f, coll) => go(reduce((_, a) => f(a), null, coll), _ => coll));

@@ -261,7 +263,7 @@

entries = Object.entries,
entries = a => a ? Object.entries(a) : [],
values = Object.values,
values = a => a ? Object.values(a) : [],
keys = Object.keys;
keys = a => a ? Object.keys(a) : [];

@@ -280,3 +282,6 @@ const basePick = filter => curry((ks, obj) => go(

const baseExtend = set => (obj, ...objs) => reduce(reduce(set), obj, L.map(entries, objs));
const baseExtend = set => tap((obj, ...objs) => {
const type = typeof obj;
if (obj && (type == 'object' || type == 'function')) reduce(reduce(set), obj, L.map(entries, objs));
});

@@ -408,6 +413,3 @@ export const

export const scat = curry((f, coll) => go(
coll,
L.map(f),
reduce((a, b) => `${a}${b}`)
));
export const scat = curry((f, coll) =>
reduce((a, b) => `${a}${b}`, '', L.map(f, coll)));
{
"name": "fxjs2",
"version": "0.0.9",
"version": "0.0.10",
"description": "Functional Extensions for Javascript",

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

@@ -19,2 +19,3 @@ ## FxJS - Functional Extensions for Javascript

- [L.filter](#L.filter)
- [go](#go)

@@ -84,1 +85,61 @@ #### map

#### go
```javascript
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' }
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc