
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
(type-aware) utility function for defining how a pipeline of functions should be composed
(type-aware) utility function for defining how a pipeline of functions should be composed
const pipe = pipeWith(fn => ma => ma.then(fn))
const fn = pipe(
v => Promise.resolve(v + 1),
v => Promise.resolve(v * 2))
fn(23).then(console.log) // 48
When using this library with flow or typescript, there is a limit of 16 arguments for pipe functions.
pipeWith(bindFn)Takes in a bind function and returns a corresponding pipe function. The pipe function composes the functions passed to it from left to right, but processes the result of each function call using the bind function. The bind function should have a type signature of (a -> m b) -> (m a -> m b).
For example, if we wanted to compose promise-returning functions, bindFn could look like this:
const bind = <A, B>(fn: A => Promise<B>): ((Promise<A>) => Promise<B>) =>
ma => ma.then(fn)
pipe([...fns])Composes the given functions from left to right. For e.g. pipe(fn1, fn2)(v) would return the same result as fn2(fn1(v)).
You can use this library as the npm package pipe-with:
npm i pipe-with
# or
yarn add pipe-with
It can be used in both es-module-aware and commonjs bundlers/environments.
// es module
import { pipeWith } from 'pipe-with'
// commonjs
const { pipeWith } = require('pipe-with')
It can also be used a <script>:
<script
crossorigin
src="https://unpkg.com/pipe-with/dist/umd/pipe-with.js"
></script>
<script>
pipeWith(...)
</script>
FAQs
(type-aware) utility function for defining how a pipeline of functions should be composed
The npm package pipe-with receives a total of 20 weekly downloads. As such, pipe-with popularity was classified as not popular.
We found that pipe-with 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.