
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
galago
/ɡəˈleɪɡoʊz/ is a set of very specific, opinionated helper functions for functional-like programming in js. It’s also the name of this animal.
🚧 Work in progress, but feel free to:
yarn add galago
# or
npm install galago --save
Or grab the source from src/index.js
or lib/index.js
(ES2015) and pluck it into your codebase as vendor code. The world is your oyster. ¯\_(ツ)_/¯
compose
and composeAsync
Both of these functions recursively reduce an a array of functions by being a typical compose function / pipe mechanism. You can terminate the mechanism early by suppyling a reduced?
function which check the output at each step.
Both functions accept the same three parameters:
@param {array<Function>} fns
— array of function to execute@param {?function} reducedFn
— optional function with signature fn(x: Any): Boolean
; if returning true, exits the call and returns the last resultcompose
returns {*}
(whatever you want), while composeAsync
returns a {Promise}
.
Important note: the functions supplied to composeAsync
don’t all have to be async/Promises — you can mix and match!
Usage example for compose
const transducer = (data) =>
compose(
data,
[fn1, fn2, fn3, fn4, … fnX]
);
Full explenation and code here.
You can also clone the repo and run yarn run example:transducer
to run this sample code.
Usage example for composeAsync
const fakeHttpEndpoint = (requestBody) =>
composeAsync(
requestBody, // acc param
[ // list of functions
parse,
validate,
transform,
saveToDb,
],
isReduced // reducedFn param
);
Full explenation and code here.
You can also clone the repo and run yarn run example:fakeHttp
to run this sample code.
branch2
🚧 TODO 🚧
branchMultiple
🚧 TODO 🚧
FAQs
galago, very specific helper functions for functional-like programming in js
We found that galago 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.