josdejong / svelte-jsoneditor

A web-based tool to view, edit, format, repair, query, transform, and validate JSON
https://jsoneditoronline.org
Other
814 stars 108 forks source link

Refactor the API to use `undefined` instead of `null` #453

Closed josdejong closed 1 week ago

josdejong commented 1 week ago

Reason: the API currently has a mix of null and undefined. To unify this, we will use undefined everywhere. This works better than null since undefined is the "default" in JavaScript, for example with optional chainging, missing properties, empty array slots, function argument defaults. Also: null is a valid JSON value, so for the Content.json type we must use undefined when there is no JSON.

This is a breaking change in the following properties and methods: