UNPKG

dynamodb-toolbox

Version:

Lightweight and type-safe query builder for DynamoDB and TypeScript.

5 lines (4 loc) 296 B
import { z } from 'zod'; import { withValidate } from '../utils.js'; import { withDecoding, withOptional } from './utils.js'; export const binaryZodFormatter = (schema, options = {}) => withDecoding(schema, options, withOptional(schema, options, withValidate(schema, z.instanceof(Uint8Array))));