All files / lib/joi-to-json-schema/types binary.ts

100% Statements 7/7
83.33% Branches 20/24
100% Functions 1/1
100% Lines 7/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 91x 2x 2x 2x 2x 2x 2x    
export const binary = (_convert, schema, joi) => {
  schema.type = "string";
  const mediaType = joi?.$_terms?.metas[0]?.contentMediaType;
  schema.contentMediaType = mediaType ? mediaType : "text/plain";
  const encoding = joi?._flags?.encoding;
  schema.contentEncoding = encoding ? encoding : "binary";
  return schema;
};