ts_serialize icon indicating copy to clipboard operation
ts_serialize copied to clipboard

151 Added handling for null class objects

Open WillForrestMindBridge opened this issue 10 months ago • 1 comments

Description

See issue 151 here

Proposed changes in this PR

  • Allow the fromSerializable strategy to return the primitive null value instead of having a null pointer exception.
    • We expect to send null in the request.
  • Undefined is protected at the level above, which makes sense, as we don't want to send it over the wire. No changes to be made in that case.

Things to look at

  • [x] Test coverage
  • [x] Code Style
  • [x] Documentation (README.md, CHANGELOG.md, etc..)

WillForrestMindBridge avatar Feb 26 '25 21:02 WillForrestMindBridge

Right now, there is a type error on many fields. I have not figured out a nice way to appease typescript yet. Working on it.

performing a deno test -c tsconfig.json --no-check shows that all tests are passing.

EDIT: got it.

WillForrestMindBridge avatar Feb 26 '25 22:02 WillForrestMindBridge

Also Thanks for the first contribution - please don't forget to add yourself to the CONTRIBUTORS.md file!

hardy613 avatar May 08 '25 18:05 hardy613

@hardy613 I don't mind rebuilding this PR ontop of your other changes. The image changes etc probably shouldn't be in the fix. I was in a bit of a hurry, and this could be a smaller PR.

What happened was we had to roll back to version 1.x for stability, and while this PR works well, it has been mildly forgotten (By mildy, probably we won't switch over to version 2.x until we have some time in summer).

WillForrestMindBridge avatar May 08 '25 18:05 WillForrestMindBridge

Closing in favor of protect_against_null_serialization_v2

WillForrestMindBridge avatar May 08 '25 20:05 WillForrestMindBridge