Conversation
|
Updated to be inline with current implementation using Hoek instead of Utils for inherits and language.js instead of languages/en_us.json |
|
What are you doing that requires Buffer validation? joi was created as a schema validation tool. I am having a hard time extending it to various JS or node types that cannot be represented in any other way than native code. |
|
There’s a database module that requires Buffers for Binary types and i’m writing a parameter checking layer on top of the database module. I was hoping to avoid having to convert the Buffer to a string and then back again. Would it be better to check if Buffer exists and return an error if it does not if trying to validate a Buffer object in a non-node environment? On Apr 8, 2014, at 10:16 PM, Eran Hammer notifications@github.com wrote:
|
|
Hmm. I might be open to some kinds of general purpose |
|
That could work and would be helpful for custom types. Or would you restrict it to core native node types only? On Apr 8, 2014, at 10:30 PM, Eran Hammer notifications@github.com wrote:
|
|
Not sure. Depends how it is implemented. |
|
Ok, after some more thinking, I like the idea of adding a |
|
Sure, I'll make this compatible with latest master |
|
Updated for latest version of master. Do you want me to add in code that checks for existence of Buffer before trying to convert a string to a buffer in the case of non-node environments? |
|
Let's see what Browserify does... |
Add support for binary type
|
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions. |
Wanted to add support for validating objects with properties of type Buffer.