Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses #162
Builds upon #167 - will be processed further after this one is merged.
There have been a few places that used
null
as a return type. While there are possible justifications for that, it was hard to ensure consistency in that regard (and it seems to be pretty uncommon in other codebases like CesiumJS). This PR changes the use of thesenull
values toundefined
.The affected places:
ResourceResolver.resolve...
functions returnednull
when the data could not be resolved, but returnundefined
nowContentData.getData
(which usually contained the data that was obtained with aResourceResolver
) could benull
, and can now beundefined
accordinglyTreeCoordinates
interface returnednull
as theparent
of root nodes. This also returnsundefined
now(The other changes are the respective implementations and places where these values had been used)
Note: There is still a large part of the codebase that does use
null
- namely, the implementations of the glTF extensions based on glTF-Transform. This is because glTF-Transform internally does usenull
, pretty consistently. So it makes sense to usenull
in these implementations as well.