phosphorjs / phosphor

The PhosphorJS Library
BSD 3-Clause "New" or "Revised" License
1.04k stars 166 forks source link

Add partial json type that allows for optional keys #417

Open vidartf opened 4 years ago

vidartf commented 4 years ago

Refactor of #303 to instead add new partial types that allow undefined value and/or missing keys ("Partial" types in TS jargon).

Some of the type names get a little long, but at least they are explicit.

vidartf commented 4 years ago

Note: While the logic in JSONExt changed to support the new type, I do not think the behavior for the old type should differ (potentially a minor performance hit). If this is not the case, or the performance hit is not acceptable, we could duplicate that into PartialJSONExt as well.