UNPKG

dynamodb-toolbox

Version:

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

15 lines (14 loc) 741 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.parseReturnValuesOption = void 0; const dynamoDBToolboxError_js_1 = require("../errors/dynamoDBToolboxError.js"); const parseReturnValuesOption = (allowedReturnValuesOptions, returnValues) => { if (!allowedReturnValuesOptions.has(returnValues)) { throw new dynamoDBToolboxError_js_1.DynamoDBToolboxError('options.invalidReturnValuesOption', { message: `Invalid returnValues option: '${String(returnValues)}'. 'returnValues' must be one of: ${[...allowedReturnValuesOptions].join(', ')}.`, payload: { returnValues } }); } return returnValues; }; exports.parseReturnValuesOption = parseReturnValuesOption;