Skip to content

v5.5.0

Latest

Choose a tag to compare

@terehov terehov released this 09 Nov 10:25

Added

  • Hex colors in pretty.styles (#394) — "#00ff00" / "#0f0" set the text color and "bg#00ff00" the background, alone or mixed with named tokens (["#ff8800", "bold"]). Browsers apply them as CSS; terminals get 24-bit ANSI colors. Thanks @jan-bukowski for the request.

Fixed

  • Masking applies to values serialized through toJSON() (#395) — with mask configured, an object whose toJSON() builds its output from data that is not a plain own property (a closure, Immutable.js collections, classes with #private fields) was written unmasked in JSON output and in a pretty error's non-Error cause. A class whose toJSON() reads #private fields made the whole JSON line disappear. toJSON() now runs on the original value and its result is masked at the same path, so keys, paths and regex all apply. If it throws, the object's own masked properties are serialized instead. Thanks @trackoor.
  • JSON render failures are reported — when a value cannot be serialized (a toJSON() or getter that throws), the default JSON output still skips the line, but now reports it on console.error instead of dropping it silently.
  • Unknown pretty.styles tokens no longer throw — with pretty.style on, a token outside the palette made every log call throw a TypeError. It now leaves the value unstyled.

v5.4.0...v5.5.0