-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The current typescript definition always indicated a string as return type. That is faulty for values such as `undefined` or symbol values. The new return type determins the correct return type depending on the input type. Fixes: #35
- Loading branch information
Showing
6 changed files
with
58 additions
and
61 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1 @@ | ||
export function stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string; | ||
export function stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string; | ||
|
||
export interface StringifyOptions { | ||
bigint?: boolean, | ||
circularValue?: string | null | TypeErrorConstructor | ErrorConstructor, | ||
deterministic?: boolean, | ||
maximumBreadth?: number, | ||
maximumDepth?: number, | ||
strict?: boolean, | ||
} | ||
|
||
export namespace stringify { | ||
export function configure(options: StringifyOptions): typeof stringify; | ||
} | ||
|
||
export function configure(options: StringifyOptions): typeof stringify; | ||
|
||
export default stringify; | ||
export * from '../index.d' |
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