UNPKG

dynamodb-toolbox

Version:

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

13 lines (12 loc) 449 B
import { $DELETE } from '../../symbols/index.js'; import { pathTokens, refOrValueTokens } from './utils.js'; export const expressDeleteUpdate = (value, path, state) => { let deleteExpression = pathTokens(path, 'd', state); deleteExpression += ' '; /** * @debt type "Fix this cast" */ deleteExpression += refOrValueTokens(value[$DELETE], 'd', state); state.deleteExpressions.push(deleteExpression); return state; };