-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing outputFormatter and standardising STDOUT #50
Conversation
970fbee
to
8ff3fc6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code doesn't build. That needs to be fixed before merging.
It was broken in #45 too so I'm not sure why that was merged. You need to follow the merge checklist because it's there to catch this kind of problem. But it's fully ticked right now even though the build fails, why is that?
There was prior review commentary located here: #45 (comment). @amydevs best to refer to the prior comments that @tegefaulkes made too. |
309d1d7
to
fc9963e
Compare
This is conflicting with staging? You may need a rebase? And also can you provide previews of what all these commands look like now? |
f6f3c21
to
8a78d50
Compare
c873e3c
to
ec4c097
Compare
no, what i'm saying is that a lot of the commands were using like this data.push(
`${vaultListMessage.vaultName}:\t${
vaultListMessage.vaultIdEncoded
}`,
); I've replaced it with spaces instead data.push(
`${vaultListMessage.vaultName}:${' '.repeat(4)}${
vaultListMessage.vaultIdEncoded
}`,
); ID generation never generated characters that had to be escaped. |
547cc0f
to
961cc81
Compare
https://stackoverflow.com/questions/20585729/how-to-detect-if-nodes-process-stdout-is-being-piped We might want to never escape when the output is being redirected btw, this will have to be done in another pr at some point if it is needed |
4ac6577
to
d7d35c7
Compare
fix: removed unneeded `arrayToAsyncIterable` utility function fix: made handling of '' and `null` cells consistent in `outputTableFormatter` fix: cleaned up tests in `utils.test.ts` fix: condensed arbitraries in `utils.test.ts` fix: removed unneeded concats of strings in `utils.test.ts` fix: `outputTableFormatter` is no longer async and `outputFormatter` no longer can return `Promise<string>` fix: cleaned up `outputFormatter` for `list` type [ci-skip]
… to avoid conflicts [ci-skip]
…adding in streaming usage fix: moved positioning of `TableRow` and `TableOptions` type [ci-skip]
…FormatterList`, `outputFormatterTable`, etc.) chore: renamed instances of `formattedOutput` to `outputFormatted` [ci-skip]
…ts/keys/certchain.test.ts` and `tests/keys/cert.test.ts`
…when strings are wrapped with `\"\"` double quotes fix: fixed raw escape character encoding on `outputFormatter` fix: encoding of quotes in `outputFormatter` is now correctly escaped [ci-skip]
chore: lintfix fix: removal of related tests to `encodeWrappedStrings` feat: encoding is now enabled/disabled based on if the string contains any encodable content feat: merged `encodeQuotes` and `encodePrintable` into `encodeEscaped` fix: corrected `encodeEscape` and `decodeEscape` behaviour regarding quotes and unicode escape sequences feat: tests for `encodeEscaped` and `decodeEscaped` fix: inline documentation for `decodeEscaped` fix: fixed expected formatting for `CommandScan` test in `vaults.test.ts` [ci-skip]
d7d35c7
to
37db593
Compare
should be done, just wrote up new api for encoding escape characters. Please refer to this PR if it comes up |
What if there's other kinds non-printable characters? Usually when quoted in JS, they appear as slash unicodes. Also I was wondering if we could have just used the standard console.log and captured it's output somehow. JS seems to have native quoting when it comes to strings. Did you have a look? |
native quoting only applies to the browser console, not the STDOUT in Node.JS At the moment, I am also turning those \u characters into escaped versions |
Description
This PR builds upon #45
And aims to fix some issues which were not resolved in their entirety in #45.
These mainly include:
Fixed Issues
Tasks
encodeEscaped
andencodeEscapedWrapped
API for output character escape encodingFinal checklist