Pickrr
Contracts in Typescript done right.
Goal
To have a simple contract in typescript that doesn't need an accompanying interface. i.e. The contract itself is the interface.
Installation
npm i --save pickrr
Usage
// Let's say req.body = {id: '1', name: 'John Doe'} ; // data now has a signature of {id: number; name: string}// and a value of {id: 1, name: 'John Doe'}
You can even pass multiple objects
; // data now has the same signature as the contract itself.
The trick?
Take a look at src/index.ts
.