update use of nullish coalescing in agent.ts #90
Closed
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.
Pull Request
Description
Issue:
This pull request contains a fix for JS SDK - Bug: build error for more details reference this issue #87
Reason:
The issue in the code was related to the misuse of the nullish coalescing operator (??). The nullish coalescing operator is designed to provide a default value only when the left operand is null or undefined. In this case, the code task.artifacts != null ?? [] inadvertently used the nullish coalescing operator with a non-null value (task.artifacts != null), leading to a boolean result (true or false) instead of an array.
Changes:
updated the code to use the nullish coalescing operator (??) correctly, providing a default value of an empty array when task.artifacts is null or undefined
Checklist
Please review and check the following items to ensure your pull request can be processed smoothly:
My code adheres to the project's coding standards and style guidelines.
I have tested my changes thoroughly, including unit tests where applicable.
I have updated the documentation to reflect any changes made in this pull request.
My branch is up-to-date with the latest changes from the main branch.
I have received code review feedback and addressed any comments or concerns.
References, Fixes and Closes