This repository was archived by the owner on Feb 20, 2026. It is now read-only.
fix: Don't throw an error for null inputs to the save function#1361
Closed
danieljbruce wants to merge 4 commits intomainfrom
Closed
fix: Don't throw an error for null inputs to the save function#1361danieljbruce wants to merge 4 commits intomainfrom
danieljbruce wants to merge 4 commits intomainfrom
Conversation
cindy-peng
approved these changes
Nov 20, 2024
kevkim-codes
approved these changes
Nov 20, 2024
Contributor
Author
|
The checks finally passed for the copied PR so merging that instead. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary:
This PR fixes issue #1327.
Background:
Taken directly from this PR
Changes:
src/entity.ts: A couple of lines have been added that prevent errors from being thrown whenarrayorentityis null or undefined. This change may not make the save function perfect and is a sign there may be more work to perfect the save function, but it is clearly an improvement because now code will work for certain inputs that used to throw useless errors.test/entity.ts: A test has been added that throws an error and fails without the new changes tosrc/entity.ts. In this test,excludeFromIndexes: trueis always in the right place.Next steps:
The save function was broken down here, but for the save function to work properly for every possible input, more edge cases for special cases with nulls, undefined values and other unique values passed into the save function should be explored.