aeirola / io-ts-promise Goto Github PK
View Code? Open in Web Editor NEWio-ts for developers who like Promises
Home Page: https://www.npmjs.com/package/io-ts-promise
License: MIT License
io-ts for developers who like Promises
Home Page: https://www.npmjs.com/package/io-ts-promise
License: MIT License
Hi, thanks for this library!
Is it possible to disable runtime checks in production? Like when NODE_ENV=='production'
?
Import doesn't work, but type checking doesn't give useful error messages either.
Since there are no use cases where io-ts-promise would be used without also including io-ts, it would make more sense to mark it as a peer depdendency, instad of as a direct dependency. This would give the users of the libraries more control of which versions are brought in.
Currently the decode
function rejects the promise with a normal Error
, making it hard to identify the reason for the promise rejection later in the promise chain.
If the library would define its own errors, such as a DecodeError
, then it would be easier to identify the errors with something like
if(error instanceof tPromise.DecodeError) {
console.warn('Unexpected data received');
}
I guess the library could also add a convenience type guard function isDecodeError(error: unknown): error is DecodeError
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.