Parse-SDK-JS icon indicating copy to clipboard operation
Parse-SDK-JS copied to clipboard

fix: Parse Object field value converts from object to array if key contains number

Open mtrezza opened this issue 1 year ago • 1 comments

Pull Request

Issue

Closes: https://github.com/parse-community/Parse-SDK-JS/issues/2198

Approach

Issue demo

Tasks

  • [x] Add tests

mtrezza avatar Jul 02 '24 00:07 mtrezza

Thanks for opening this pull request!

@mtrezza this fix would return wrong output e.g.

  1. { field: 'object', value: { '1x1': 1, '2': 2, '3': 3 } }, return as jsonArray which is wrong
  2. { field: 'object', value: { '1': 1 } }, return as jsonArray which is also wrong as 0 index is missing I have created a PR https://github.com/parse-community/Parse-SDK-JS/pull/2206/ which considers these cases as well.

mkmandar123 avatar Jul 05 '24 12:07 mkmandar123

An index of 0 is not required for an array to be an array. See https://github.com/parse-community/Parse-SDK-JS/issues/2198#issuecomment-2210725825.

mtrezza avatar Jul 05 '24 20:07 mtrezza

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (b50790a) to head (83066f2). Report is 103 commits behind head on alpha.

Additional details and impacted files
@@            Coverage Diff             @@
##             alpha     #2201    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           61        64     +3     
  Lines         6186      6358   +172     
  Branches      1499      1528    +29     
==========================================
+ Hits          6186      6358   +172     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jul 07 '24 11:07 codecov[bot]

@dplewis anything else that should be removed from the changes in https://github.com/parse-community/Parse-SDK-JS/pull/2120/files? Or can we merge

mtrezza avatar Jul 07 '24 12:07 mtrezza

Thats it, this is ready to merge

dplewis avatar Jul 07 '24 12:07 dplewis

🎉 This change has been released in version 5.3.0-alpha.2

parseplatformorg avatar Jul 07 '24 12:07 parseplatformorg

🎉 This change has been released in version 5.3.0-beta.1

parseplatformorg avatar Jul 07 '24 15:07 parseplatformorg

🎉 This change has been released in version 5.3.0

parseplatformorg avatar Jul 07 '24 15:07 parseplatformorg