io-ts-excess
A type for io-ts library, which will fail on any additional properties.
Thanks to @gcanti for the original code.
Warning! Does not work from inside intersection!
Usage
;; ; ; console.logPathReporter.reportC.decode;// [ 'Invalid value {"a":"a","b":1} supplied to : { a: string }, excess properties: ["b"]' ]
TODO
- Make it to work inside intersection. The following code does not work for now:
console.logPathReporter.reportI.decode// [ 'Invalid value {"a":"a","b":1} supplied to : { a: string }, excess properties: ["b"]' ]