unexpected icon indicating copy to clipboard operation
unexpected copied to clipboard

Pass custom options to inspect/diff?

Open papandreou opened this issue 10 years ago • 1 comments

Currently the only thing that can be adjusted is the depth.

I've run into some cases where it would be handy if inspect and diff accepted some options that the inspect/diff for each type could pick up on.

  • binaryArray.inspect method currently has an arbitrary limit of 16 bytes. Unexpected-mitm would like to set that to +Infinity in one case.
  • binaryArray.diff currently has a somewhat arbitrary diffLimit of 512, which it would be nice to decrease in some cases and increase in others.
  • swirl would like for unexpected-messy to use an inspection depth of Infinity for JSON/HTML/XML request/response bodies that don't have conflicts if a --verbose parameter is given.

Interestingly, the preferredWidth setting can actually be overridden per MagicPen instance, so maybe that could be a place to place such customizations?

papandreou avatar Jun 19 '15 14:06 papandreou

I guess the best results would be achieved by trying to adapt the width to preferredWidth - depth * indentationWidth.

sunesimonsen avatar Sep 02 '15 12:09 sunesimonsen