UNPKG

dynamodb-toolbox

Version:

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

12 lines (11 loc) 527 B
import { DynamoDBToolboxError } from '../errors/dynamoDBToolboxError.js'; import { isBoolean } from '../utils/validation/isBoolean.js'; export const parseShowEntityAttrOption = (showEntityAttr) => { if (!isBoolean(showEntityAttr)) { throw new DynamoDBToolboxError('options.invalidShowEntityAttrOption', { message: `Invalid 'showEntityAttr' option: '${String(showEntityAttr)}'. 'showEntityAttr' must be a boolean.`, payload: { showEntityAttr } }); } return showEntityAttr; };