glideapps/quicktype

Find a better JSON parser or implement our own

已關閉

#646 建立於 2018年3月8日

 (12 則留言) (2 個反應) (0 位負責人)TypeScript (968 個分叉)batch import
good first issue

倉庫指標

星標
 (10,867 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Required features:

  • Streaming. We need to process files larger than V8 strings allow.
  • Preserve property order.
  • Good and actionable error messages. Our users often have issues with invalid JSON.
  • Recover from common errors.
  • Distinguish between integers and floating point numbers.
  • Span for each non-symbol token - line number and column of start and end.

Common errors:

  • Unquoted keys: { foo: "bar" }
  • Superfluous commas: [1, 2, 3,]
  • Wrong delimiter: [ "foo": "bar" ], { 1, 2, 3 }

Other easily recoverable errors:

  • = (or anything else) instead of : in objects: { "foo"="bar" }
  • Number format stuff, such as no digits before point (.3), leading zeros (0123), hexadecimals (0xdeadbeef)

貢獻者指南