Giter Site home page Giter Site logo

awesomize's People

Contributors

bellk17 avatar cdeborja avatar eostretsov avatar influentialmatt avatar kolossion avatar mszymulanski avatar scull7 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

awesomize's Issues

Allow Synchronous Validation

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.

Show dataOrError usage

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);

Dependent Validations Fail - Change the execution flow to run steps in sequence.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.