Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements the tryGet() function as defined by ARM to safely retrieve values from arrays and objects without throwing errors when keys or indices don't exist.
- Adds a new
tryGet()function that returns null for non-existent keys/indices instead of failing - Supports both object property access by string key and array element access by numeric index
- Includes comprehensive test coverage for both positive and negative scenarios
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lib/dsc-lib/src/functions/try_get.rs | Implements the complete tryGet function with object/array access logic and unit tests |
| lib/dsc-lib/src/functions/mod.rs | Registers the new tryGet function in the function dispatcher |
| lib/dsc-lib/locales/en-us.toml | Adds localized strings for function description and error messages |
| dsc/tests/dsc_functions.tests.ps1 | Adds integration tests covering various tryGet usage scenarios |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
tgauth
approved these changes
Oct 15, 2025
Collaborator
|
Can you update the PR context since the other PR will close that issue? |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR Summary
Add the
tryGet()function as defined by ARMPR Context
Partly addresses #1180