UNPKG

dynamodb-toolbox

Version:

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

22 lines (21 loc) 752 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fromItemSchemaDTO = void 0; const index_js_1 = require("../../../../schema/item/index.js"); const attribute_js_1 = require("./attribute.js"); /** * @debt feature "handle defaults, links & validators" */ const fromItemSchemaDTO = ({ keyDefault, putDefault, updateDefault, keyLink, putLink, updateLink, attributes }) => { keyDefault; putDefault; updateDefault; keyLink; putLink; updateLink; return (0, index_js_1.item)(Object.fromEntries(Object.entries(attributes).map(([attributeName, attribute]) => [ attributeName, (0, attribute_js_1.fromSchemaDTO)(attribute) ]))); }; exports.fromItemSchemaDTO = fromItemSchemaDTO;