Security News
Internet Archive Hacked, 31 Million Record Compromised
The Internet Archive's "Wayback Machine" has been hacked and defaced, with 31 millions records compromised.
This lib contains utility functions for e3, dataflower and other projects.
npm install u3
bower install u3
In this documentation I used the lib as follows:
var u3 = require("u3"),
cache = u3.cache,
eachCombination = u3.eachCombination;
The cache(fn)
function caches the fn results, so by the next calls it will return the result of the first call.
You can use different arguments, but they won't affect the return value.
var a = cache(function fn(x, y, z){
return x + y + z;
});
console.log(a(1, 2, 3)); // 6
console.log(a()); // 6
console.log(a()); // 6
The eachCombination(alternativesByDimension, callback)
calls the callback(a,b,c,...)
on each combination of the alternatives[a[],b[],c[],...]
.
eachCombination([
[1, 2, 3],
["a", "b"],
], console.log);
/*
1, "a"
1, "b"
2, "a"
2, "b"
3, "a"
3, "b"
*/
You can use any dimension and number of alternatives. In the current example we used 2 dimensions. By the first dimension we used 3 alternatives: [1, 2, 3]
and by the second dimension we used 2 alternatives: ["a", "b"]
.
MIT - 2016 Jánszky László Lajos
FAQs
u3 - Utility Functions
The npm package u3 receives a total of 50,124 weekly downloads. As such, u3 popularity was classified as popular.
We found that u3 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
The Internet Archive's "Wayback Machine" has been hacked and defaced, with 31 millions records compromised.
Security News
TC39 is meeting in Tokyo this week and they have approved nearly a dozen proposals to advance to the next stages.
Security News
Our threat research team breaks down two malicious npm packages designed to exploit developer trust, steal your data, and destroy data on your machine.