hapijs / joi

The most powerful data validation library for JS
Other
20.95k stars 1.51k forks source link

Associate Buffer with BinarySchema #2961

Closed jpage-godaddy closed 1 year ago

jpage-godaddy commented 1 year ago

This fixes the ability do have types like:

type Photo = {
  id: number,
  caption: string,
  content: Buffer
};

const schemaProps: SchemaMap<Photo, true> = {
  id: Joi.number(),
  caption: Joi.string(),
  content: Joi.binary()
};
Marsup commented 1 year ago

Thanks!