-
Notifications
You must be signed in to change notification settings - Fork 634
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
docs(json): lint @std/json
docs
#4798
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4798 +/- ##
==========================================
- Coverage 92.32% 91.92% -0.41%
==========================================
Files 481 481
Lines 38747 38754 +7
Branches 5444 5409 -35
==========================================
- Hits 35775 35624 -151
- Misses 2917 3073 +156
- Partials 55 57 +2 ☔ View full report in Codecov by Sentry. |
FYI, we just updated the doc checker to check classes. Hence, the lint failure(s). |
* ``` | ||
*/ | ||
export class ConcatenatedJsonParseStream | ||
implements TransformStream<string, JsonValue> { | ||
/** A writable stream of byte data. */ | ||
// TODO(iuioiua): Investigate why this class is implemented differently to the other JSON streams. | ||
/** |
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.
I went with this for now. I didn't bother with a proper example because this, as a public property, seems like a mistake/fault, and may get removed in the future.
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.
To my understanding readable
and writable
are necessary to be exposed for a TransformStream
instance working as a TransformStream
.
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.
I just meant how this implements TransformStream
rather than extending it.
PTAL @kt3k |
* ``` | ||
*/ | ||
export class ConcatenatedJsonParseStream | ||
implements TransformStream<string, JsonValue> { | ||
/** A writable stream of byte data. */ | ||
// TODO(iuioiua): Investigate why this class is implemented differently to the other JSON streams. |
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.
JSONParseStream
supposes every chunk is valid JSON string which represents a single JSON object. ConcatenatedJsonParseStream
handles stream of strings where each chunk can be incomplete fragments of JSON strings.
This difference exists because in NDJSON or JSONLines, each line contains single JSON object. So we can use TextLineStream
to split them and pass the result to JSONParseStream
. On the other hand, in Concatenated JSON, there's no explicit delimiter of JSONs. So the class needs to maintain the internal parsing state of JSONs
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.
LGTM
No description provided.