You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first three arguments are the same as to JSON.stringify.
But when I try to pass an array of strings as the second parameter, the module raises an error:
> var object = { a: 'b', c: 'd' }
undefined
> stringify(object, ['a'])
TypeError: undefined is not a function
at Object.<anonymous> (/node_modules/json-stringify-safe/stringify.js:25:48)
at Object.stringify (native)
at stringify (/node_modules/json-stringify-safe/stringify.js:5:15)
at repl:1:11
at REPLServer.defaultEval (repl.js:132:27)
at bound (domain.js:254:14)
at REPLServer.runBound [as eval] (domain.js:267:12)
at REPLServer.<anonymous> (repl.js:279:12)
at REPLServer.emit (events.js:107:17)
at REPLServer.Interface._onLine (readline.js:214:10)
The same argument works with JSON.stringify:
> JSON.stringify(object, ['a'])
'{"a":"b"}'
The text was updated successfully, but these errors were encountered:
The documentations says:
But when I try to pass an array of strings as the second parameter, the module raises an error:
The same argument works with
JSON.stringify
:The text was updated successfully, but these errors were encountered: