code: function replaceNodeWith(node, newNode) {
      let done = false;
      const parent = node.$parent;
      const keys = Object.keys(parent);
      keys.forEach(function(key) {
          if (parent[key] === node) {
              parent[key] = newNode;
              done = true;
          }
      });
  
      if (done) {
          return;
      }
  
      // second pass, now check arrays
      keys.forEach(function(key) {
          if (Array.isArray(parent[key])) {
              const arr = parent[key];
              for (let i = 0; i < arr.length; i++) {
                  if (arr[i] === node) {
                      arr[i] = newNode;
                      done = true;
                  }
              }
          }
      });
  
      assert(done);
  }
docs: stand-in for not having a jsshaper-style ref's