GithubHelp home page GithubHelp logo

thosakwe / feathers-validator Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 4.0 19 KB

WIP. A validator for Feathers services, or any service.

Home Page: https://www.npmjs.com/package/feathers-validator

License: GNU General Public License v2.0

JavaScript 100.00%

feathers-validator's People

Contributors

kanchanay avatar selahattinunlu avatar thosakwe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

feathers-validator's Issues

unique custom validator

Hello, i am making unique validator function. But encountered a problem , the response of query is coming after return can you help me with this.

function generateUniqueValidatorFunction(params, data){
"use strict";
return function (key, value){
var query = {};
var res;
query[params[1]] = data[params[1]];
hook.app.service(hook.path).find({query: query }).then(function(found){
console.log('found '+ JSON.stringify(found));
if(found.data.length > 0){
return { valid: true };
}else{
return {
valid: false,
error: 'The '+ key + ' must be unique.'
};
}

    });    
}

}

Please Help!!!!!

Rule 'min' return error on numeric data

log:
app:services:user data { fullName: 'test name', password: '123456' } +0ms
app:services:user rule { fullName: 'required|min:6', password: 'required|min:6' } +3ms
app:services:user errors [ 'The size of the password field must be greater than or equal to 6.' ] +2ms

purpose

Sorry for my ignorance..., but when do you need this validator? I am working with sequelize within feathersjs. As the ORM already provides 'validation rules' I do not think I need it, but maybe I just don't get it?

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.