UNPKG

dynamodb-toolbox

Version:

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

13 lines (12 loc) 517 B
import { EntityParser } from '../../../../entity/actions/parse/index.js'; import { parseGetItemOptions } from './parseGetItemOptions.js'; export const getItemParams = (entity, input, options = {}) => { var _a; const { key } = entity.build(EntityParser).parse(input, { mode: 'key' }); const awsOptions = parseGetItemOptions(entity, options); return { TableName: (_a = options.tableName) !== null && _a !== void 0 ? _a : entity.table.getName(), Key: key, ...awsOptions }; };