juanjoDiaz / streamparser-json

Streaming JSON parser in Javascript for Node.js and the browser
MIT License
133 stars 10 forks source link

error TS7029: Fallthrough case in switch #28

Closed kaiyoma closed 1 year ago

kaiyoma commented 1 year ago

I just tried migrating from the old json2csv package to the new one, and now I'm getting type errors from within node_modules:

../../common/temp/node_modules/.pnpm/@streamparser+json@0.0.12/node_modules/@streamparser/json/src/tokenizer.ts:374:11 - error TS7029: Fallthrough case in switch.

374           case TokenizerStates.STRING_UNICODE_DIGIT_4:
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../common/temp/node_modules/.pnpm/@streamparser+json@0.0.12/node_modules/@streamparser/json/src/tokenizer.ts:500:11 - error TS7029: Fallthrough case in switch.

500           case TokenizerStates.NUMBER_AFTER_E:
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../../common/temp/node_modules/.pnpm/@streamparser+json@0.0.12/node_modules/@streamparser/json/src/tokenizer.ts:697:18 - error TS6133: 'parsedToken' is declared but its value is never read.

697   public onToken(parsedToken: ParsedTokenInfo): void {
                     ~~~~~~~~~~~

../../common/temp/node_modules/.pnpm/@streamparser+json@0.0.12/node_modules/@streamparser/json/src/tokenparser.ts:324:18 - error TS6133: 'parsedElementInfo' is declared but its value is never read.

324   public onValue(parsedElementInfo: ParsedElementInfo): void {
                     ~~~~~~~~~~~~~~~~~

Found 4 errors in 2 files.

Errors  Files
     3  ../../common/temp/node_modules/.pnpm/@streamparser+json@0.0.12/node_modules/@streamparser/json/src/tokenizer.ts:374
     1  ../../common/temp/node_modules/.pnpm/@streamparser+json@0.0.12/node_modules/@streamparser/json/src/tokenparser.ts:324
juanjoDiaz commented 1 year ago

Please read before publishing. This was already reported as #26 and already fixed in version 14.

This issue should go to the json2csv repo. And I'm about to update it there as well 🙂

kaiyoma commented 1 year ago

I just installed the latest version of @json2csv/plainjs and version 0.0.12 of this package was installed.