UNPKG

dynamodb-toolbox

Version:

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

18 lines (17 loc) 554 B
import { item } from '../../../../schema/item/index.js'; import { fromSchemaDTO } from './attribute.js'; /** * @debt feature "handle defaults, links & validators" */ export const fromItemSchemaDTO = ({ keyDefault, putDefault, updateDefault, keyLink, putLink, updateLink, attributes }) => { keyDefault; putDefault; updateDefault; keyLink; putLink; updateLink; return item(Object.fromEntries(Object.entries(attributes).map(([attributeName, attribute]) => [ attributeName, fromSchemaDTO(attribute) ]))); };