-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick core proposal and deploy-script-support changes (#8747)
For upgrade-14
- Loading branch information
Showing
25 changed files
with
623 additions
and
921 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// @ts-check | ||
|
||
/** | ||
* Parses JSON and, if necessary, throws exceptions that include the location | ||
* of the offending file. | ||
* | ||
* @param {string} source | ||
* @param {string} location | ||
*/ | ||
export const parseLocatedJson = (source, location) => { | ||
try { | ||
return JSON.parse(source); | ||
} catch (error) { | ||
if (error instanceof SyntaxError) { | ||
throw SyntaxError(`Cannot parse JSON from ${location}, ${error}`); | ||
} | ||
throw error; | ||
} | ||
}; |
Oops, something went wrong.