Skip to content

Commit

Permalink
Make object key regexp ignore leading whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
acusti committed May 6, 2024
1 parent 5f3f5df commit fbb9eac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/parsing/src/parse-as-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ function lengthOf(item: unknown): number {
const getObjectKeyFromIndex = (index: number) =>
`"key${index === 1 ? '' : '-' + index}":`;

const OBJECT_KEY_REGEXP = /^"[^"]+":/;
const OBJECT_KEY_REGEXP = /^\s*"[^"]+":/;

type ParsedValue = string | boolean | number | GenericObject | Array<unknown>;

Expand Down

0 comments on commit fbb9eac

Please sign in to comment.