Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "zo", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "asynchronous query language, for the usual functional list processing functions: map, select, reduce, but async-friendly", | ||
@@ -12,9 +12,2 @@ "maintainers": [ | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/refractalize/zo.git" | ||
}, | ||
"files": [ | ||
"zo.js" | ||
], | ||
"main": "zo.js", | ||
@@ -21,0 +14,0 @@ "dependencies": { |
48
zo.js
@@ -35,20 +35,15 @@ var _ = require('underscore'); | ||
var foldElement = function (first, folder, mapItems) { | ||
var foldl = function (first, folder) { | ||
pipeline.push(function (items, next) { | ||
var n = items.length; | ||
var foldedResult = first; | ||
var xyz = function (foldedResult, index, items, next) { | ||
if (index >= items.length) { | ||
next(foldedResult); | ||
} else { | ||
folder(foldedResult, items[index], function (folded) { | ||
xyz(folded, index + 1, items, next); | ||
}); | ||
} | ||
}; | ||
if (n > 0) { | ||
_(mapItems(items)).each(function (item) { | ||
folder(foldedResult, item, function (folded) { | ||
foldedResult = folded; | ||
n--; | ||
if (n == 0) { | ||
next(foldedResult); | ||
} | ||
}); | ||
}); | ||
} else { | ||
next(foldedResult); | ||
} | ||
xyz(first, 0, items, next); | ||
}); | ||
@@ -58,12 +53,17 @@ return zo(items, pipeline); | ||
var foldl = function (first, folder) { | ||
return foldElement(first, folder, function (items) { | ||
return items; | ||
}); | ||
}; | ||
var foldr = function (first, folder) { | ||
pipeline.push(function (items, next) { | ||
var xyz = function (foldedResult, index, items, next) { | ||
if (index < 0) { | ||
next(foldedResult); | ||
} else { | ||
folder(foldedResult, items[index], function (folded) { | ||
xyz(folded, index - 1, items, next); | ||
}); | ||
} | ||
}; | ||
var foldr = function (first, folder) { | ||
return foldElement(first, folder, function (items) { | ||
return _(items).reverse(); | ||
xyz(first, items.length - 1, items, next); | ||
}); | ||
return zo(items, pipeline); | ||
}; | ||
@@ -70,0 +70,0 @@ |
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 4 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
58247
15
195
1
102
2
4