Skip to content

Conversation

SteveL-MSFT
Copy link
Member

PR Summary

Add the tryGet() function as defined by ARM

PR Context

Fix #1180

@SteveL-MSFT SteveL-MSFT requested review from Copilot and tgauth October 13, 2025 21:11
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dynamic dot notation parser error

1 participant