Pipe implementation with (almost) variadic kinds
npm install @csvenke/pipe
Install •
Usage •
Development •
Credits •
License
Using npm
```
npm install --save @csvenke/pipe
Using yarn
``
yarn add @csvenke/pipe
With javascript
`js
import pipe from "@csvenke/pipe";
const getName = data => data.name;
const toUpperCase = str => str.toUpperCase();
const reverse = str => str.split("").reverse().join("");
const piped = pipe(getName, toUpperCase, reverse);
console.log(piped({ name: "John" })); // NHOJ
`
With typescript
`ts
import pipe from "@csvenke/pipe";
interface Data {
name: string;
}
const getName = (data: Data) => data.name;
const toUpperCase = (str: string) => str.toUpperCase();
const reverse = (str: string) => str.split("").reverse().join("");
const piped = pipe(getName, toUpperCase, reverse);
console.log(piped({ name: "John" })); // NHOJ
`
Installing dependencies
``
yarn install
Running tests
```
yarn test
- This wouldn't have been possible without jcalz amazing stack overflow answer!
MIT