Giter VIP home page Giter VIP logo

Comments (21)

WesTyler avatar WesTyler commented on May 18, 2024

(Edited to add string.regex support)

from felicity.

WesTyler avatar WesTyler commented on May 18, 2024

(Edited to add any.valid support and string.insensitive)

from felicity.

WesTyler avatar WesTyler commented on May 18, 2024

(Edited to add string hex, alphanum, token, creditCard, hostname, and uui)

from felicity.

WesTyler avatar WesTyler commented on May 18, 2024

(Edited to add any forbidden, strip, and allow)

from felicity.

lamchakchan avatar lamchakchan commented on May 18, 2024

(Edited to add function arity(n), minArity(n) and maxArity(n))

from felicity.

lamchakchan avatar lamchakchan commented on May 18, 2024

(Edited to add array single)

from felicity.

lamchakchan avatar lamchakchan commented on May 18, 2024

(Edited to add string ip)

from felicity.

lamchakchan avatar lamchakchan commented on May 18, 2024

(Edited to add string uppercase and lowercase)

from felicity.

lamchakchan avatar lamchakchan commented on May 18, 2024

@WesTyler I don't think all of these API contracts from joi needs to be supported. It looks like some of these contracts are actually actions and not validations that we can reverse generate a value from. Check this out. I started updated the initial list with should not need for your review.

from felicity.

lamchakchan avatar lamchakchan commented on May 18, 2024

@WesTyler Looks like you already took care of date.format([string]). I'm looking at here.

from felicity.

WesTyler avatar WesTyler commented on May 18, 2024

@lamchakchan re: date.format you're right. I updated the README but not this issue when I made the PR. Issue is now updated. Thanks!

For the action contracts, you're right. I want to have at minimum a test on Felicity.entityFor though, just to make sure there are no unknown Joi internals that interfere with how Felicity is interacting with the describe api for those options.

from felicity.

WesTyler avatar WesTyler commented on May 18, 2024

(Edited to indicate string.truncate, string.trim, and string.replace are tested and have no problems.)

from felicity.

lamchakchan avatar lamchakchan commented on May 18, 2024

(Edited to add object rename)

from felicity.

lamchakchan avatar lamchakchan commented on May 18, 2024

(Edited to add object and and or)

from felicity.

lamchakchan avatar lamchakchan commented on May 18, 2024

@WesTyler seems like the Object.type() API is going to require some Joi PR's to add pass through for Function:constructor pointers. As of right now, when you setup a schema with the following:

let CustomClass = function() {};
CustomClass.prototype = {};

Joi.object().keys({
    prop1 : Joi.any()
}).type(CustomClass);

We get from Joi in their schema the following:

{
   ...
   _tests : [{
      func : [Func], // not of type CustomClass
      name : 'type',
      arg : 'CustomClass'
   }]
}

There is a way for us to create a new constructor based off of the arg value. But this then becomes a totally new Object entity that does not validate when using instanceof keyword against the original one that was defined.

from felicity.

lamchakchan avatar lamchakchan commented on May 18, 2024

(Edited to add object unknown)

from felicity.

lamchakchan avatar lamchakchan commented on May 18, 2024

(Edited to add object schema)

from felicity.

WesTyler avatar WesTyler commented on May 18, 2024

(Edited to indicate lack of coverage on new Joi v10 features: boolean().truthy()/.falsy() and string().regex(/pattern/, { invert: true }))

from felicity.

lamchakchan avatar lamchakchan commented on May 18, 2024

(Edited to add object type)

from felicity.

lamchakchan avatar lamchakchan commented on May 18, 2024

(Edited to add boolean truthy and falsy)

from felicity.

WesTyler avatar WesTyler commented on May 18, 2024

Closing this to mark where v1 is at the time of release.

from felicity.

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.