UNPKG

dynamodb-toolbox

Version:

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

12 lines (11 loc) 547 B
import { DynamoDBToolboxError } from '../errors/dynamoDBToolboxError.js'; import { isString } from '../utils/validation/isString.js'; export const parseClientRequestToken = (clientRequestToken) => { if (!isString(clientRequestToken)) { throw new DynamoDBToolboxError('options.invalidClientRequestToken', { message: `Invalid client request token option: '${String(clientRequestToken)}'. 'clientRequestToken' must be a string.`, payload: { clientRequestToken } }); } return clientRequestToken; };