dynamodb-toolbox
Version:
Lightweight and type-safe query builder for DynamoDB and TypeScript.
17 lines (16 loc) • 588 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getItemSchemaDTO = void 0;
const schema_js_1 = require("./schema.js");
const getItemSchemaDTO = (schema) => {
const { strict } = schema.props;
return {
type: 'item',
attributes: Object.fromEntries(Object.entries(schema.attributes).map(([attributeName, attribute]) => [
attributeName,
(0, schema_js_1.getSchemaDTO)(attribute)
])),
...(strict !== undefined && strict ? { strict } : {})
};
};
exports.getItemSchemaDTO = getItemSchemaDTO;