UNPKG

dynamodb-toolbox

Version:

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

14 lines (13 loc) 585 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fromSchemaDTO = void 0; const index_js_1 = require("../../../schema/item/index.js"); const index_js_2 = require("./fromSchemaDTO/index.js"); const fromSchemaDTO = (schemaDTO) => { const schema = (0, index_js_1.item)(Object.fromEntries(Object.entries(schemaDTO.attributes).map(([attributeName, attributeDTO]) => [ attributeName, (0, index_js_2.fromSchemaDTO)(attributeDTO) ]))); return schemaDTO.strict ? schema.strict() : schema; }; exports.fromSchemaDTO = fromSchemaDTO;