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) {
113113 try {
114114 return _parse ( text , reviver , { safe : true } )
115115 } catch ( _e ) {
116- return null
116+ return undefined
117117 } finally {
118118 Error . stackTraceLimit = stackTraceLimit
119119 }
Original file line number Diff line number Diff line change @@ -432,10 +432,10 @@ test('safeParse', t => {
432432 t . end ( )
433433 } )
434434
435- t . test ( 'returns null on invalid object string' , t => {
435+ t . test ( 'returns undefined on invalid object string' , t => {
436436 t . strictEqual (
437437 j . safeParse ( '{"a": 5, "b": 6' ) ,
438- null
438+ undefined
439439 )
440440 t . end ( )
441441 } )
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ declare namespace parse {
3737 *
3838 * @param text The JSON text string.
3939 * @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.
4141 */
4242 export function safeParse ( text : string | Buffer , reviver ?: Reviver | null ) : any
4343
You can’t perform that action at this time.
0 commit comments