dynamodb-toolbox
Version:
Lightweight and type-safe query builder for DynamoDB and TypeScript.
22 lines (21 loc) • 763 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromMapSchemaDTO = void 0;
const index_js_1 = require("../../../../schema/map/index.js");
const attribute_js_1 = require("./attribute.js");
/**
* @debt feature "handle defaults, links & validators"
*/
const fromMapSchemaDTO = ({ keyDefault, putDefault, updateDefault, keyLink, putLink, updateLink, attributes, ...props }) => {
keyDefault;
putDefault;
updateDefault;
keyLink;
putLink;
updateLink;
return (0, index_js_1.map)(Object.fromEntries(Object.entries(attributes).map(([attributeName, attribute]) => [
attributeName,
(0, attribute_js_1.fromSchemaDTO)(attribute)
])), props);
};
exports.fromMapSchemaDTO = fromMapSchemaDTO;