File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ function safeParse (text, reviver) {
113
113
try {
114
114
return _parse ( text , reviver , { safe : true } )
115
115
} catch ( _e ) {
116
- return null
116
+ return undefined
117
117
} finally {
118
118
Error . stackTraceLimit = stackTraceLimit
119
119
}
Original file line number Diff line number Diff line change @@ -432,10 +432,10 @@ test('safeParse', t => {
432
432
t . end ( )
433
433
} )
434
434
435
- t . test ( 'returns null on invalid object string' , t => {
435
+ t . test ( 'returns undefined on invalid object string' , t => {
436
436
t . strictEqual (
437
437
j . safeParse ( '{"a": 5, "b": 6' ) ,
438
- null
438
+ undefined
439
439
)
440
440
t . end ( )
441
441
} )
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ declare namespace parse {
37
37
*
38
38
* @param text The JSON text string.
39
39
* @param reviver The `JSON.parse()` optional `reviver` argument.
40
- * @returns The parsed object, or `null ` if there was an error or if the JSON contained possibly insecure properties.
40
+ * @returns The parsed object, or `undefined ` if there was an error or if the JSON contained possibly insecure properties.
41
41
*/
42
42
export function safeParse ( text : string | Buffer , reviver ?: Reviver | null ) : any
43
43
You can’t perform that action at this time.
0 commit comments