1.0.1 • Published 6 years ago
@csvenke/pipe v1.0.1
Install
Using npm
npm install --save @csvenke/pipeUsing yarn
yarn add @csvenke/pipeUsage
With javascript
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" })); // NHOJWith typescript
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" })); // NHOJDevelopment
Installing dependencies
yarn installRunning tests
yarn testCredits
- This wouldn't have been possible without jcalz amazing stack overflow answer!
License
MIT