
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
pipe-and-compose-types
Advanced tools
This package strictly contains types. The star of this package is a recursive Pipe type with surprising utility over parameter overloading. These benefits include
Pipe and ComposeIt's biggest weakness is still stronger than the parameter overloading approach, namely generics on compose functions are not preserved; however, it will accept them and the resulting type will be {}. The overloading approach can actually often fail to compile in those situations.
The main benefit of the overloading approach to this recursive type is that when error occur, the compiler is better able to explain where the error occurred. With this type, in the event of a compile error, the returned type will itself contain information on what went wrong.
Key exported types include
Pipe as mentioned aboveCompose data flows from bottom up ( or left to right )PipeFn Pipe applied to create a reference function typeComposeFn Compose applied to create a reference function typePipelineFn Pipe applied to create a useful pipeline function typeOther types exported
ExtractFunctionArguments extracts function argumentsExtractFunctionReturnValue extracts a functions return typeAd-hoc types that may aid in constructing applications from these types.
AnyFunction a type representing any kind of function, an alternative to FunctionAnyFunction1 a function representing any function with an arity of 1npm install pipe-and-compose-types
Example:
import { PipeFn } from 'pipe-and-compose-types'
declare const example: ( first: number, rest: number[] ) => number
declare const pipe: PipeFn
const result = pipe(
example,
String
) // (first: number, rest: number[]) => string
Read more at https://dev.to/babak/introducing-the-recursive-pipe-and-compose-types-3g9o
FAQs
Powerful Typescript types for `pipe` and `compose`
We found that pipe-and-compose-types 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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.