Skip to content

Diff function produces no output #254

Open

Description

@jcollum-nutrien

Start by rendering a page, get this result, click on item 1:

image

Save as a global:

image

When I run the global function the result is undefined:

image

I have seen this function produce detailed output before. So either I'm doing something wrong or there's a bug.

Activity

  1. jcollum-nutrien commented on Aug 25, 2022

    @jcollum-nutrien
    Author

    Talked this over with another dev and the issue is probably due to circular references in the object. If you want to fix that:

    const getCircularReplacer = () => {
      const seen = new WeakSet();
      return (key, value) => {
        if (typeof value === 'object' && value !== null) {
          if (seen.has(value)) {
            return;
          }
          seen.add(value);
        }
        return value;
      };
    };
    
    
    JSON.stringify(obj, getCircularReplacer());
    
  2. jcollum-nutrien commented on Aug 26, 2022

    @jcollum-nutrien
    Author

    Related #250

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions