UNPKG

dynamodb-toolbox

Version:

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

17 lines (16 loc) 704 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getItemParams = void 0; const index_js_1 = require("../../../../entity/actions/parse/index.js"); const parseGetItemOptions_js_1 = require("./parseGetItemOptions.js"); const getItemParams = (entity, input, options = {}) => { var _a; const { key } = entity.build(index_js_1.EntityParser).parse(input, { mode: 'key' }); const awsOptions = (0, parseGetItemOptions_js_1.parseGetItemOptions)(entity, options); return { TableName: (_a = options.tableName) !== null && _a !== void 0 ? _a : entity.table.getName(), Key: key, ...awsOptions }; }; exports.getItemParams = getItemParams;