UNPKG

dynamodb-toolbox

Version:

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

18 lines (17 loc) 735 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.putItemParams = void 0; const index_js_1 = require("../../../../entity/actions/parse/index.js"); const parsePutItemOptions_js_1 = require("./parsePutItemOptions.js"); const putItemParams = (entity, input, options = {}) => { var _a; const { parsedItem, item } = entity.build(index_js_1.EntityParser).parse(input); const awsOptions = (0, parsePutItemOptions_js_1.parsePutItemOptions)(entity, options); return { TableName: (_a = options.tableName) !== null && _a !== void 0 ? _a : entity.table.getName(), Item: item, ToolboxItem: parsedItem, ...awsOptions }; }; exports.putItemParams = putItemParams;