Giter Site home page Giter Site logo

Comments (15)

sebelga avatar sebelga commented on May 25, 2024 1

@mAiNiNfEcTiOn no problem, congrats for your new child! And thanks for the PR. I made some comment there, I will now run the tests

from gstore-node.

sebelga avatar sebelga commented on May 25, 2024 1

@jainanshul @machinshin it has just been released in the last version. Thanks again to @mAiNiNfEcTiOn for the feature 👍

from gstore-node.

jainanshul avatar jainanshul commented on May 25, 2024 1

Thank you both for working on it. Will test and provide feedback shortly.

from gstore-node.

machinshin avatar machinshin commented on May 25, 2024 1

@mAiNiNfEcTiOn congratulations to you & your partner on your new baby! :)
Totally understand that fatherhood has to take priority, and thanks for getting back to this PR! :)

@sebelga awesome, thank you!

from gstore-node.

sebelga avatar sebelga commented on May 25, 2024

Hi, no it does not but it would be a good feature to add. I put it on my todo list :)

from gstore-node.

mAiNiNfEcTiOn avatar mAiNiNfEcTiOn commented on May 25, 2024

Actually this brings the opportunity to consider custom validation functions :)

Doing something like:

// Private function, receives the value to be validated. Other args defined in the Schema.
const myCustomFunction = (value, arg1, arg2, arg3, arg4, ..., argN) => {
  const isValid = ['success_rate', 'failure_rate'].every(key => (key in value) && (typeof value[key] === 'number'));
  return isValid;
};

// Model/Schema definition
const Model = gstore.model('MyModel', {
  results: {
    type: 'object',
    validate: {
      rule: myCustomFunction,
      args: ['arg1', 'arg2', 'arg3', 'arg4', ..., 'argN'],
    }
  }
});

Also, when considering the case above, exposing validator.js and the schema definitions to the custom validation function would allow the devs to re-use validation definitions :)

(Just my 2 cent)

from gstore-node.

sebelga avatar sebelga commented on May 25, 2024

@mAiNiNfEcTiOn I think that's a great idea. If you want to give it a try go ahead. I am right now in the middle of changing both job + city so I won't have much time these coming weeks to work on gstore. All the help very much appreciated! :)

from gstore-node.

mAiNiNfEcTiOn avatar mAiNiNfEcTiOn commented on May 25, 2024

@sebelga ok, will dedicate some time to it tomorrow. 👍

Success for your new adventure!

from gstore-node.

sebelga avatar sebelga commented on May 25, 2024

thanks @mAiNiNfEcTiOn !

from gstore-node.

mAiNiNfEcTiOn avatar mAiNiNfEcTiOn commented on May 25, 2024

Hi @jainanshul and @sebelga , sorry for no input on this one. Got hit by a storm of stuff to do at work.

Will try to find some time during the next week to do this implementation.

from gstore-node.

jainanshul avatar jainanshul commented on May 25, 2024

No rush, thanks for the quick update.

from gstore-node.

sebelga avatar sebelga commented on May 25, 2024

Hi @mAiNiNfEcTiOn No problem, I understand perfectly I am in the same situation! :) Hopefully in a week or so I should be able to work again on gstore-node. Thanks for the update!

from gstore-node.

sebelga avatar sebelga commented on May 25, 2024

@mAiNiNfEcTiOn after some time working on the refactor of all the responses in the library I am back on looking at new feature :) Probably the custom function validation would be the next one. I guess that you are still quiet busy, should I have a look at it based on your suggestion?

from gstore-node.

machinshin avatar machinshin commented on May 25, 2024

hi @sebelga,

I would also love to have this embedded validation feature.

from gstore-node.

mAiNiNfEcTiOn avatar mAiNiNfEcTiOn commented on May 25, 2024

@machinshin and @sebelga sorry about that... Became a father on the 11th of April 2017 🎉 and before didn't have much time (neither now ... but at least I came up with this PR to try to implement it)

from gstore-node.

Related Issues (20)

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.