influentialpublishers / awesomize Goto Github PK
View Code? Open in Web Editor NEWTotally Awesome Validation/Sanitization/Normalization for your app.
License: MIT License
Totally Awesome Validation/Sanitization/Normalization for your app.
License: MIT License
Awesomizer should have a function like AwesomizeSync
that could possibly still use the Awesomize
function and simply enforce that the promise is immediately resolved and return the result.
This would allow users to use the familiar declarative interface without adding the complexities with handling the result in an asynchronous context.
Currently the awesomize function will map over all of the specification items and execute the actions in parallel. This needs to be changed so that it will execute all reads, then all sanitize calls, then all validate calls and finally all the normalize calls. The current execution order causes dependent validations to be impossible.
Edit the README.md to show how we use the dataOr error function internally.
const Awesomize = require('awesomize');
function ValidationError(results) {
this.message = 'ValidationError';
this.name = 'ValidationError';
this.status = 400;
this.validation = results;
}
ValidationError.prototype = Object.create(Error.prototype);
ValidationError.prototype.constructor = ValidationError;
const throwValidationError = (results) => {
throw new ValidationError(results);
};
module.exports = Awesomize.dataOrError(throwValidationError);
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.