Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add lib types for JSON.rawJSON, JSON.isRawJSON, and reviver context#7

Open
hbrooks wants to merge 7 commits into
mainellipsis-dev-test/TypeScript:mainfrom
demo/pr-63248ellipsis-dev-test/TypeScript:demo/pr-63248Copy head branch name to clipboard
Open

Add lib types for JSON.rawJSON, JSON.isRawJSON, and reviver context#7
hbrooks wants to merge 7 commits into
mainellipsis-dev-test/TypeScript:mainfrom
demo/pr-63248ellipsis-dev-test/TypeScript:demo/pr-63248Copy head branch name to clipboard

Conversation

@hbrooks

@hbrooks hbrooks commented May 28, 2026

Copy link
Copy Markdown

Originally PR microsoft#63248 in microsoft/TypeScript by @VedantMadane

VedantMadane and others added 7 commits March 13, 2026 08:32
Adds esnext.json.d.ts with type definitions for the Stage 4 TC39
proposal-json-parse-with-source (shipped in all major browsers and
Node.js 22+):

- JSON.rawJSON(text): creates a RawJSON object for lossless serialization
- JSON.isRawJSON(value): type guard narrowing to RawJSON
- JSON.parse reviver context: third parameter with { source: string }

Fixes microsoft#61330
The proposal-json-parse-with-source is Stage 4 and part of ES2025,
so the lib should live in es2025.json.d.ts, not esnext.json.d.ts.
RyanCavanaugh noted this PR is still valid minus commandlineParser.ts.
Revert commandLineParser.ts to match upstream main.
- Add test cases for array elements and nested structures.
- Ensure JSDoc aligns with existing patterns.

Signed-off-by: Vedant Madane <vedantnm@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.