You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'll have to think about a way out of this one, this is a classical inheritance model, so declaring the base you indeed inherit from it, not from the one extended by the previous extension. The behavior is expected but probably not what you would expect.
I created two extensions for the
number
type. Once for file sizes and one for durations.The end goal is being able to coherce a configuration file like
{ ttl: '1 minute', maxSize: '1MB' }
to{ ttl: 60000, maxSize: 1000000 }
It seems Joi keeps only the last extension for every
name
.All the extensions I saw, e.g. 1, 2 and 3, are using a base type such as
number
ordate
as the name so I figured this is the correct approach.So my question is how to create multiple extensions for a single base type?
Here is an example showing my issue:
Outputs:
The text was updated successfully, but these errors were encountered: