Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
clojure-thread-async
Advanced tools
Clojure threading macro. Supports first
, last
, and as
macro. No
support for binding.
const thread = require('clojure-thread-async')
// first
// returns 9
await thread.first(
1,
x => x * 10,
[(x, y) => x - y, 1]
)
// last
// returns -9
await thread.last(
1,
x => x * 10,
[(x, y) => x - y, 1]
)
// as
// returns -8
// second argument must be a function that
// takes a placeholder as input (which is just
// an empty object) and
// returns an array of functions or arrays
await thread.as(
1,
placeholder => [
x => x * 10,
[(x, y) => x - y, placeholder, 1],
[(x, y) => x - y, 1, placeholder]
]
)
// React Redux reducer
const reducer = (state = 0, action) => {
switch(action.type) {
case "INC":
return state + 1
default:
return state
}
}
const state = thread.first(
reducer(undefined, {}),
[reducer, {type: "INC"}],
)
console.log(state == 1)
FAQs
Clojure thread macro in JS
We found that clojure-thread-async 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.