fix: normalize undefined to null and replace placeholders, fixes #14 #15#47
Merged
Dancode-188 merged 1 commit intomainfrom Dec 27, 2025
Merged
Conversation
Two related issues in variable extraction: 1. extractVariables could return undefined when JSONPath finds nothing, but should return null for consistency with error handling. 2. interpolateVariables kept {{placeholder}} syntax when variables were undefined/null instead of replacing them with string representations. Changes: - Normalize JSONPath undefined results to null - Replace undefined variables with 'undefined' string - Replace null variables with 'null' string This makes variable handling consistent and prevents stale placeholders in interpolated text.
Owner
Author
|
Fixes both consistency issues. Normalizing to null is cleaner than mixing undefined/null, and replacing placeholders with string representations makes debugging easier. CI passing. |
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.
Fixes #14, #15
Problems
Two related bugs in variable extraction:
undefined vs null: extractVariables could store
undefinedwhen JSONPath finds nothing, but the error case storesnull. Inconsistent.Placeholder retention: When interpolating variables,
{{placeholder}}syntax was kept in the output when variables were undefined/null. Makes it impossible to distinguish between actual placeholder syntax and missing variables.Changes
undefinedresults tonull'undefined''null'Now variable values are consistent and placeholders actually get replaced.