复杂的自定义着色


🌐 Complex custom coloring

可以将方法定义为样式。它接收输入的字符串化值。当启用着色且类型被检查时,会调用该方法。

🌐 It is possible to define a method as style. It receives the stringified value of the input. It is invoked in case coloring is active and the type is inspected.

示例:util.inspect.styles.regexp(value)

🌐 Example: util.inspect.styles.regexp(value)

  • value <string> 输入类型的字符串表示。
  • 返回:<string> object 的调整表示。