forked from apache/superset
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle BigNumber conversions in JSON properly (without loss of precis…
…ion) (#71) * Handle BigNumber conversions in JSON properly (without loss of precision) * Rewrap "errors" from JSONbig.parse in proper error object. * Use DefinitelyTyped's fetch-mock type def * Improved type def for json-bigint * Added type casts to some tests due to addition of fetchMock type def
- Loading branch information
1 parent
9cdbcad
commit 7a53ce1
Showing
6 changed files
with
100 additions
and
11 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
31 changes: 30 additions & 1 deletion
31
...end/temporary_superset_ui/superset-ui/packages/superset-ui-connection/types/external.d.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 +1,30 @@ | ||
declare module 'fetch-mock'; | ||
declare module 'json-bigint' { | ||
interface JSONbig { | ||
/** | ||
* Converts a JavaScript Object Notation (JSON) string into an object, preserving precision for numeric values. | ||
* @param text A valid JSON string. | ||
* @param reviver A function that transforms the results. This function is called for each member of the object. | ||
* If a member contains nested objects, the nested objects are transformed before the parent object is. | ||
*/ | ||
parse(text: string, reviver?: (key: any, value: any) => any): any; | ||
|
||
/** | ||
* Converts a JavaScript value to a JavaScript Object Notation (JSON) string, preserving precision for numeric values. | ||
* @param value A JavaScript value, usually an object or array, to be converted. | ||
* @param replacer A function that transforms the results, or an array of strings and numbers that acts | ||
* as a approved list for selecting the object properties that will be stringified. | ||
* @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. | ||
*/ | ||
stringify( | ||
value: any, | ||
replacer?: (number | string)[] | null | ((key: string, value: any) => any), | ||
space?: string | number, | ||
): string; | ||
} | ||
|
||
/** | ||
* An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format. | ||
*/ | ||
const JSONbig: JSONbig; | ||
export = JSONbig; | ||
} |