dazn-lambda-powertools icon indicating copy to clipboard operation
dazn-lambda-powertools copied to clipboard

feat(dynamodb-client): add word boundary in regex

Open joaodfmota opened this issue 3 years ago • 0 comments

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

joaodfmota avatar Feb 24 '21 13:02 joaodfmota