Feat: Add toggle for primitive parsing via env variable#194
Draft
Feat: Add toggle for primitive parsing via env variable#194
Conversation
Member
Author
|
Fixes #190 |
a43ed13 to
94b382b
Compare
Bump Node version
Introduces an environment variable `GAUGE_TS_DISABLE_PRIMITIVE_PARSING` to control the automatic parsing of parameters to primitive types (number, boolean). - If `GAUGE_TS_DISABLE_PRIMITIVE_PARSING` is set to `true` (case-insensitive), the `PrimitiveParser` will bypass conversions and return all parameters as their original string values. This provides backward compatibility for projects expecting all parameters as strings. - If the variable is unset or set to `false`, the existing (stricter) primitive parsing logic applies. Unit tests in `PrimitiveParserTests.ts` have been updated to reflect this toggleable behavior, ensuring that parsing enabling/disabling works as expected.
Introduces an environment variable `GAUGE_TS_DISABLE_PRIMITIVE_PARSING` to control the automatic parsing of parameters to primitive types (number, boolean). - If `GAUGE_TS_DISABLE_PRIMITIVE_PARSING` is set to `true` (case-insensitive), the `PrimitiveParser` will bypass conversions and return all parameters as their original string values. This provides backward compatibility for projects expecting all parameters as strings. - If the variable is unset or set to `false`, the existing (stricter) primitive parsing logic applies. Unit tests in `PrimitiveParserTests.ts` have been updated to reflect this toggleable behavior, ensuring that parsing enabling/disabling works as expected. Fix formatting Fix lint errors Formatting issues Use biome formatter
94b382b to
6766467
Compare
Updates relative paths in test imports to fix references. Changes number parsing logic to handle valid numeric formats using regex pattern matching instead of string comparison. Removes ES2023 lib from tsconfig and adds explicit tsconfig reference in Jest config. Improves test command by adding --no-watchman flag and simplifies test regex pattern.
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.
Introduces an environment variable
GAUGE_TS_DISABLE_PRIMITIVE_PARSINGto control the automatic parsing of parameters to primitive types (number, boolean).GAUGE_TS_DISABLE_PRIMITIVE_PARSINGis set totrue(case-insensitive), thePrimitiveParserwill bypass conversions and return all parameters as their original string values. This provides backward compatibility for projects expecting all parameters as strings.false, the existing (stricter) primitive parsing logic applies.Unit tests in
PrimitiveParserTests.tshave been updated to reflect this toggleable behavior, ensuring that parsing enabling/disabling works as expected.