-
-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #922 from MaddyUnderStars/maddy/bodyParserPatch
Patch body-parser to use json-bigint, like gateway
- Loading branch information
Showing
11 changed files
with
146 additions
and
50 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,30 @@ | ||
diff --git a/node_modules/body-parser/lib/types/json.js b/node_modules/body-parser/lib/types/json.js | ||
index c2745be..7104cfa 100644 | ||
--- a/node_modules/body-parser/lib/types/json.js | ||
+++ b/node_modules/body-parser/lib/types/json.js | ||
@@ -18,6 +18,7 @@ var createError = require('http-errors') | ||
var debug = require('debug')('body-parser:json') | ||
var read = require('../read') | ||
var typeis = require('type-is') | ||
+var JSONbig = require("json-bigint"); | ||
|
||
/** | ||
* Module exports. | ||
@@ -86,7 +87,7 @@ function json (options) { | ||
|
||
try { | ||
debug('parse json') | ||
- return JSON.parse(body, reviver) | ||
+ return JSONbig.parse(body, reviver) | ||
} catch (e) { | ||
throw normalizeJsonSyntaxError(e, { | ||
message: e.message, | ||
@@ -157,7 +158,7 @@ function createStrictSyntaxError (str, char) { | ||
: '' | ||
|
||
try { | ||
- JSON.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation') | ||
+ JSONbig.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation') | ||
} catch (e) { | ||
return normalizeJsonSyntaxError(e, { | ||
message: e.message.replace('#', char), |
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
4 changes: 2 additions & 2 deletions
4
src/util/config/types/subconfigurations/defaults/UserDefaults.ts
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export class UserDefaults { | ||
premium: boolean = false; | ||
premium_type: number = 2; | ||
premium: boolean = true; | ||
premiumType: number = 2; | ||
verified: boolean = true; | ||
} |
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
Oops, something went wrong.