Bug: Browser Polyfill does not validate that inspect
is actually a function
#216
Labels
bug
Something isn't working
inspect
is actually a function
#216
Describe the bug
util.inspect.polyfill.ts
presumes that any function given to it has aninspect
method:https://github.com/fullstack-build/tslog/blob/master/src/runtime/browser/util.inspect.polyfil.ts#L154-L164
To Reproduce
Here's a slightly simplified (but same logic) copy of that area of the function that can be ran in browser console:
I think it can be easily fixed by just checking that
value.inspect
is a function:Additional context
We ran into this while logging a class that has functions on it using the default pretty logger. We didn't realize it would recurse through all fields and presume that any functions it comes across will have this
inspect
function.tslog version
4.7.2
The text was updated successfully, but these errors were encountered: