Uh oh!
There was an error while loading. Please reload this page.
typings: add typing for string decoder - #38229
Conversation
| /** | ||
| * | ||
| * @param {string} enc | ||
| * @returns {"utf8" | "utf16le" | "hex" | "ascii" | "base64" | "latin1" | "base64url"} |
There was a problem hiding this comment.
| * @returns{"utf8"|"utf16le"|"hex"|"ascii"|"base64"|"latin1"|"base64url"} | |
| * @returns{"utf8"|"utf16le"|"hex"|"ascii" | |
| *|"base64"|"latin1"|"base64url"} |
What about this?
Co-authored-by: Michaël Zasso <targos@protonmail.com>
Uh oh!
There was an error while loading. Please reload this page.
marsonya
left a comment
There was a problem hiding this comment.
I would suggest adding function descriptions in the jsdoc comments.
| }; | ||
| /** | ||
| * |
There was a problem hiding this comment.
| * | |
| *Returnsanyremaininginputstoredintheinternalbufferasastring. | |
| *Afterend()iscalled,thestringDecoderobjectcanbereusedfornewinput. |
| // buffers into a series of JS strings without breaking apart multi-byte | ||
| // characters. | ||
| /** | ||
| * |
There was a problem hiding this comment.
Move the above description inside the comment?
| } | ||
| /** | ||
| * |
There was a problem hiding this comment.
| * | |
| *Returnsadecodedstring,omittinganyincompletemultibyte | |
| *charactersattheendoftheBuffer,orTypedArray,orDataView |
Co-authored-by: marsonya <akhil.marsonya27@gmail.com>
marsonya
left a comment
There was a problem hiding this comment.
Mark optional params as such and assign default value using JSDoc conventions.
Kindly ignore it incase this is too much detailing. I know we don't want to duplicate the documentation here using JSDoc. I just feel that it would be important information for core developers to know whether a param is optional or not and what it's default value would be.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Ayase-252
commented
Apr 21, 2021
Good idea, I will address optional arugment issue |
Co-authored-by: Akhil Marsonya <akhil.marsonya27@gmail.com>
nodejs-github-bot
commented
Dec 30, 2021
Commit Queue failed- Loading data for nodejs/node/pull/38229 ✔ Done loading data for nodejs/node/pull/38229 ----------------------------------- PR info ------------------------------------ Title typings: add typing for string decoder (#38229) Author Qingyu Deng (@Ayase-252) Branch Ayase-252:feature/typing-lib-internal-cipher -> nodejs:master Labels string_decoder, typings, commit-queue-squash Commits 4 - typings: add typing for internal/string_decoder - fixup: typings: add typing for internal/string_decoder - fixup: add function description - fixup: mark optional parameters Committers 1 - Qingyu Deng PR-URL: https://github.com/nodejs/node/pull/38229 Reviewed-By: James M Snell Reviewed-By: Antoine du Hamel ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/38229 Reviewed-By: James M Snell Reviewed-By: Antoine du Hamel -------------------------------------------------------------------------------- ℹ This PR was created on Tue, 13 Apr 2021 15:40:00 GMT ✔ Approvals: 2 ✔ - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/38229#pullrequestreview-640365320 ✔ - Antoine du Hamel (@aduh95) (TSC): https://github.com/nodejs/node/pull/38229#pullrequestreview-842115810 ✔ Last GitHub CI successful ✖ No Jenkins CI runs detected -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/1639087835 |
aduh95
commented
Dec 30, 2021
Landed in a100a93 |
PR-URL: #38229 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #38229 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #38229 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This PR adds some JSDoc typings for internal/string_decoder.
Screenshots from my VS code:
normalizeEncodingStringDecoderStringDecoder.prototype.writeStringDecoder.prototype.endStringDecoder.prototype.text