UNPKG

dynamodb-toolbox

Version:

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

9 lines (8 loc) 283 B
import { getSchemaDTO } from './schema.js'; export const getItemSchemaDTO = (schema) => ({ type: 'item', attributes: Object.fromEntries(Object.entries(schema.attributes).map(([attributeName, attribute]) => [ attributeName, getSchemaDTO(attribute) ])) });