File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -37,9 +37,9 @@ export class ReadBuffer {
3737}
3838
3939/**
40- * Safely parses a JSON string, returning false if parsing fails.
41- * @param line The JSON string to parse.
42- * @returns The parsed object, or false if parsing failed.
40+ * Safely parses a JSON string, returning false if parsing fails.
41+ * @param line The JSON string to parse.
42+ * @returns The parsed object, or false if parsing failed.
4343 */
4444function safeJsonParse ( line : string ) : object | false {
4545 try {
Original file line number Diff line number Diff line change @@ -112,10 +112,10 @@ describe('non-JSON line filtering', () => {
112112
113113 test ( 'should filter out lines which looks like JSON but are not valid JSON' , ( ) => {
114114 const readBuffer = new ReadBuffer ( ) ;
115-
115+
116116 const content = '{invalidJson: true}\n' + JSON . stringify ( testMessage ) + '\n' ;
117117 readBuffer . append ( Buffer . from ( content ) ) ;
118-
118+
119119 // Should only get the valid message, invalid JSON line filtered out
120120 expect ( readBuffer . readMessage ( ) ) . toEqual ( testMessage ) ;
121121 expect ( readBuffer . readMessage ( ) ) . toBeNull ( ) ;
You can’t perform that action at this time.
0 commit comments