Repository navigation
feat: eval --raw prints a string result as is, without JSON quotes - #909
Draft
Omarinho12345 wants to merge 1 commit into
Draft
Omarinho12345 wants to merge 1 commit into
Omarinho12345 wants to merge 1 commit into
Conversation
Owner
|
Thanks a lot for this, really nice first contribution! 🙌 I checked it out locally: build, tests and lint pass, and Once CI is green, mark it ready for review and I'll merge it. |
This branch has not been deployed
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.
Closes #870.
What changed
bdg eval --raw(andbdg dom eval --raw) prints a string result as is: no JSON quoting, no escaping.bdg eval '"40.00"' --rawprints40.00; a string with a newline prints over two lines.--rawnothing changes: a string that would read as another value (the empty string,undefined, valid JSON such as"42"or"[1,2]") stays JSON-quoted.number,object,undefined) and--jsonoutput are unchanged, and--fullstill lifts the 20000-character cut.--help, in the machine-readable option behaviour table, indocs/CLI_REFERENCE.mdand in thebdgskill.Scripts that read a value today get
"40.00"and have to strip the quotes;--rawreturns the value itself.Verification
npx tsx --test src/ui/formatters/__tests__/dom.unit.test.ts src/commands/__tests__/optionBehaviors.unit.test.ts— 32 passed. New cases cover40.00,42,undefined, the empty string, multi-line text and JSON-looking strings with--raw; unchanged output without it; and the character cap still applying without--full.npm run type-checkandnpm run lint(0 errors) pass; touched files are Prettier-clean.