dynamodb-toolbox
Version:
Lightweight and type-safe query builder for DynamoDB and TypeScript.
13 lines (12 loc) • 483 B
JavaScript
import { Entity } from '../../../entity/index.js';
import { fromSchemaDTO } from '../../../schema/actions/fromDTO/index.js';
import { fromTableDTO } from '../../../table/actions/fromDTO/index.js';
export const fromEntityDTO = ({ entityName, schema, table, timestamps, ...entity }) => new Entity({
name: entityName,
schema: fromSchemaDTO(schema),
table: fromTableDTO(table),
timestamps: timestamps,
...entity,
// @ts-expect-error
computeKey: undefined
});