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
{{ message }}
Repository navigation
Can't pass null as 2nd parameter to stringify() #104
I get this error when passing null as 2nd parameter to stringify():
TS2345 [ERROR]: Argument of type 'null' is not assignable to parameter of type '(string | number)[] | ((this: any, key: string, value: any) => any) | undefined'.
console.log(stringify({a:1, b:2}, null, 3));
I can pass null as 2nd parameter to JSON.stringify()
NOTE: I can, in fact, pass undefined as 2nd parameter to your stringify(), so I have an easy workaround
To Reproduce
console.log(stringify({a:1, b:2}, null, 3));
Platform/Env (please complete the following information):
$ deno --version
deno 2.9.3 (stable, release, x86_64-pc-windows-msvc)
v8 14.9.207.2-rusty
typescript 6.0.3
Using flatted 3.4.2
When I look at your stringify() function in github, it look like it should allow null, but it doesn't
Activity
WebReflection commentedon Jul 22, 2026
this is a TS error and it has nothing to do with the library, right?
WebReflection commentedon Jul 22, 2026
fixed ... I suppose, this wasn't a library bug though, rather a TS one, the library works just fine.
Fix WebReflection#104 - allow `null` as replacer value