UNPKG

dynamodb-toolbox

Version:

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

14 lines (13 loc) 548 B
import { EntityParser } from '../../../../entity/actions/parse/index.js'; import { parsePutItemOptions } from './parsePutItemOptions.js'; export const putItemParams = (entity, input, options = {}) => { var _a; const { parsedItem, item } = entity.build(EntityParser).parse(input); const awsOptions = parsePutItemOptions(entity, options); return { TableName: (_a = options.tableName) !== null && _a !== void 0 ? _a : entity.table.getName(), Item: item, ToolboxItem: parsedItem, ...awsOptions }; };