dynamodb-toolbox
Version:
Lightweight and type-safe query builder for DynamoDB and TypeScript.
17 lines (16 loc) • 728 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.deleteItemParams = void 0;
const index_js_1 = require("../../../../entity/actions/parse/index.js");
const parseDeleteItemOptions_js_1 = require("./parseDeleteItemOptions.js");
const deleteItemParams = (entity, input, options = {}) => {
var _a;
const { key } = entity.build(index_js_1.EntityParser).parse(input, { mode: 'key' });
const awsOptions = (0, parseDeleteItemOptions_js_1.parseDeleteItemOptions)(entity, options);
return {
TableName: (_a = options.tableName) !== null && _a !== void 0 ? _a : entity.table.getName(),
Key: key,
...awsOptions
};
};
exports.deleteItemParams = deleteItemParams;