With your latest implementation, a FilterExpression was always added to tableParams. Since DynamoDB doesn't like empty expressions and FilterExpressiont cannot contain keys, it would throw an error if only Hash or Hash/Sort keys were provided.
This checks to see if more than just keys are provided, and if so, includes the filter. Otherwise the filter is not added.
JSLint had a field day with the formatting. - Real changes are only lines 32-34 and lines 948-950.
P.s. I would love if you could open the project up to issues so we can start a discussion about a few things.
With your latest implementation, a FilterExpression was always added to tableParams. Since DynamoDB doesn't like empty expressions and FilterExpressiont cannot contain keys, it would throw an error if only Hash or Hash/Sort keys were provided.
This checks to see if more than just keys are provided, and if so, includes the filter. Otherwise the filter is not added.
JSLint had a field day with the formatting. - Real changes are only lines 32-34 and lines 948-950.
P.s. I would love if you could open the project up to issues so we can start a discussion about a few things.