Skip to content

cli: stdin JSON detection breaks on leading whitespace/BOM #18

Description

@JavaGT

Lane: CLI/UX (sweep 3, F4)
stdin JSON detection is source.charAt(0) !== "{" (cli/pbjs.js:390); any leading whitespace/BOM routes pretty-printed JSON to the proto parser, which fails with a stack trace (reproduced: \n{...} on stdin → throw at pbjs.js:403, exit 1). Fix shape: trim/strip BOM before the sniff, or try-JSON-then-proto.

Verdicts: both Confirm, Worth exploring.

Upstream: no hits.

Decision question: Adopt the trim/BOM strip on the stdin path?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions