Skip to content

Conversation

chrysomallos
Copy link

@chrysomallos chrysomallos commented May 30, 2024

Currently the serialize in dynamodb will return [null, null] instead of [0, 0].
Issue found in a not correct check at lib/serializer.js:142, the values 0 and '' are result as null, because they are truish at this check.
Result of new test case without the changes on lib/serializer.js to see the issue:

Serializer
       #serializeItem
         should serialize number array with zeros:

      AssertionError: expected { id: 1, resolution: [ null, null ] } to deeply equal { id: 1, resolution: [ +0, +0 ] }
      + expected - actual

       {
         "id": 1
         "resolution": [
      -    [null]
      -    [null]
      +    0
      +    0
         ]
       }

      at Context.<anonymous> (test\serializer-test.js:543:19)
      at process.processImmediate (node:internal/timers:476:21)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant