dazn-lambda-powertools
dazn-lambda-powertools copied to clipboard
feat(dynamodb-client): add word boundary in regex
What did you implement:
Closes #242
How did you implement it:
Added word boundary /b
in exprSegments
How can we verify it:
The following UpdateExpression:
"SET #assets = list_append(if_not_exists(#assets, :empty_list), :assets)"
Throw "Invalid UpdateExpression: Syntax error; token: \",\", near: \"#as, #LambdaPowertoolsContext\""
This happens because exprSegments
without word boundaries produces the following result:
["SET", "#as", "set", "s = list_append(if_not_exists(#as", "set", "s, :empty_list), :as", "set", "s)"]
Adding the word boundary produces the expected result:
["SET", "#assets = list_append(if_not_exists(#assets, :empty_list), :assets)"]
Is this ready for review?: YES Is it a breaking change?: NO