dynamodb-toolbox
Version:
Lightweight and type-safe query builder for DynamoDB and TypeScript.
18 lines (17 loc) • 940 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseNoEntityMatchBehavior = exports.noEntityMatchBehaviorSet = void 0;
const dynamoDBToolboxError_js_1 = require("../errors/dynamoDBToolboxError.js");
exports.noEntityMatchBehaviorSet = new Set(['DISCARD', 'THROW']);
const parseNoEntityMatchBehavior = (noEntityMatchBehavior) => {
if (!exports.noEntityMatchBehaviorSet.has(noEntityMatchBehavior)) {
throw new dynamoDBToolboxError_js_1.DynamoDBToolboxError('options.invalidNoEntityMatchBehaviorOption', {
message: `Invalid noEntityMatchBehavior option: '${String(noEntityMatchBehavior)}'. 'noEntityMatchBehavior' must be one of: ${[
...exports.noEntityMatchBehaviorSet
].join(', ')}.`,
payload: { noEntityMatchBehavior }
});
}
return noEntityMatchBehavior;
};
exports.parseNoEntityMatchBehavior = parseNoEntityMatchBehavior;