Skip to content

Commit

Permalink
[bug] Allow "undefined" like if it was its "null" brethren (#103)
Browse files Browse the repository at this point in the history
Why
===

JavaScript likes to have nullish types. We have `null` already, but we
missed `undefined`.

What changed
============

This change allows `undefined` to be defined.

Test plan
=========

Codegen gen'd!
  • Loading branch information
lhchavez authored Oct 31, 2024
1 parent 1c06a0b commit c3a7da3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion replit_river/codegen/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def extract_props(tpe: RiverType) -> list[dict[str, RiverType]]:
elif type.type == "boolean":
typeddict_encoder.append("x")
return ("bool", ())
elif type.type == "null":
elif type.type == "null" or type.type == "undefined":
typeddict_encoder.append("None")
return ("None", ())
elif type.type == "Date":
Expand Down

0 comments on commit c3a7da3

Please sign in to comment.