util: allow symbol-based custom inspection methods
Add a `util.inspect.custom` Symbol which can be used to customize `util.inspect()` output. Providing `obj[util.inspect.custom]` works like providing `obj.inspect`, except that the former allows avoiding name clashes with other `inspect()` methods. Fixes: https://github.com/nodejs/node/issues/8071 PR-URL: https://github.com/nodejs/node/pull/8174 Reviewed-By:James M Snell <jasnell@gmail.com> Reviewed-By:
Michaël Zasso <mic.besace@gmail.com>
parent
6e50fc76
Please register or sign in to comment