UNPKG

dynamodb-toolbox

Version:

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

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