
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Wait, it's that easy to make a pointfree curried version of ImmutableJS? If I could read function lengths, could I repeat that for other libs like RxJS, or even the entire standard library?
const pointfree = require('pointfree');
// generates curried function versions of JS functions/methods
var P = R.map(pointfree)({ String, Number });
// curried method, with method-calling object as the last argument:
P.String.replace(/o+/g)('b')('foo') // 'fb'
// curried function, argument order intact:
P.Number.parseInt('539')(16) // 1337
// optional arguments always use default values:
P.String.includes('f')('food') // true -- optional `position`: default 0
P.String.includes('f')(2)('food') // fails, arity is 2
// explicit-arity variants enable optional arguments:
P.String.includes3('f')(2)('food') // works, false
// alternatively, force explicitly passing arities:
const DYNAMIC = 0;
var P = R.map(cls => pointfree(cls, DYNAMIC))({ String, Number });
P.String.includes(3)('f', 2, 'food'); // arity: 3
P.String.includes(3)('f')(2)('food'); // rest still curried, of course
// built-in? libraries? all can be curried!
var P = R.map(pointfree)({ Array, Object, Promise, Set, Observable });
// heck, why not just pick out some you like?
let { then, then2 } = P.Promise;
// look mom, pointfree without R.pipeP!
let thenThisThenThat = R.pipe(then(fnA), then2(fnB, catcher));
// manually picking classes too much effort? why not grab all in `window`?
const classes = R.pipe(
Object.getOwnPropertyNames,
R.map(k => [k, window[k]]),
R.fromPairs,
R.filter(c => c && c.prototype),
)(window);
// curried Array methods? check. Date? sure. Map or Promise? yep, unless you're on IE5.
var P = R.map(pointfree)(classes);
// ImmutableJS?
let Immutable = require('immutable');
var P = R.map(pointfree)({ Immutable.Map }); // boom, that's not a valid key...
let { Map: IMap, Set: ISet } = Immutable;
var P = R.map(pointfree)({ IMap, ISet }); // yay! free curry for everyone!
But... I could just write
p=>p.then(f)
!
Yeah. That get's a bit more verbose if you start using TypeScript/Flow typings though,
e.g. <T>(p: Promise<T>) => p.then(f)
At that point P.Promise.then(f)
would... finally pay off a little.
I've yet to add typings though...
Until then, maybe this pays off a bit better using say let { then } = P.Promise;
then then(f)
.
FAQs
pointfree curried anything
The npm package pointfree receives a total of 0 weekly downloads. As such, pointfree popularity was classified as not popular.
We found that pointfree 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.