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.1.3 to 0.1.4

36

fx.js

@@ -109,26 +109,21 @@ export const

L.flat = L.flatten = function(iter) {
iter = iter[Symbol.iterator]();
let flatting = null;
L.flat = L.flatten = function(iter, depth = 1) {
const iterStack = [iter[Symbol.iterator]()];
return {
next: function recur() {
if (flatting) {
const cur = flatting.next();
if (!cur.done) return cur;
flatting = null;
}
const iter = last(iterStack);
if (!iter) return { done: true };
const cur = iter.next();
if (cur.done) return cur;
if (hasIter(cur.value)) {
flatting = cur.value[Symbol.iterator]();
if (cur.done) {
iterStack.pop();
return recur();
} else if (iterStack.length <= depth && isIterable(cur.value) && typeof cur.value != 'string') {
iterStack.push(cur.value[Symbol.iterator]());
return recur();
} else if (cur.value instanceof Promise) {
return {
value: cur.value.then(value => {
if (!hasIter(value)) return value;
flatting = value[Symbol.iterator]();
const cur = flatting.next();
return cur.done ? Promise.reject(nop) : cur.value;
if (iterStack.length > depth || !isIterable(value) || typeof value == 'string') return value;
const iter = value[Symbol.iterator](), cur = iter.next();
return cur.done ? Promise.reject(nop) : (iterStack.push(iter), cur.value);
}),

@@ -145,8 +140,3 @@ done: false

L.deepFlat = L.deep_flat = L.deepFlatten = L.deep_flatten = function *f(iter) {
for (const a of iter) {
if (typeof a != 'string' && hasIter(a)) yield *f(a);
else yield a;
}
};
L.deepFlat = L.deep_flat = L.deepFlatten = L.deep_flatten = iter => L.flat(iter, Infinity);

@@ -153,0 +143,0 @@ L.flatMap = L.flat_map = curry((f, iter) => L.flat(L.map(f, iter)));

{
"name": "fxjs2",
"version": "0.1.3",
"version": "0.1.4",
"description": "Functional Extensions for Javascript",

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

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