dynamodb-toolbox
Version:
Lightweight and type-safe query builder for DynamoDB and TypeScript.
18 lines (17 loc) • 567 B
JavaScript
import { map } from '../../../../schema/map/index.js';
import { fromSchemaDTO } from './attribute.js';
/**
* @debt feature "handle defaults, links & validators"
*/
export const fromMapSchemaDTO = ({ keyDefault, putDefault, updateDefault, keyLink, putLink, updateLink, attributes, ...props }) => {
keyDefault;
putDefault;
updateDefault;
keyLink;
putLink;
updateLink;
return map(Object.fromEntries(Object.entries(attributes).map(([attributeName, attribute]) => [
attributeName,
fromSchemaDTO(attribute)
])), props);
};