code: function setPathMap(
      pathMap, depth, root, parent, node,
      requestedPaths, optimizedPaths, requestedPath, optimizedPath,
      version, expired, lru, comparator, errorSelector) {
  
      var keys = getKeys(pathMap);
  
      if (keys && keys.length) {
  
          var keyIndex = 0;
          var keyCount = keys.length;
          var optimizedIndex = optimizedPath.index;
  
          do {
              var key = keys[keyIndex];
              var child = pathMap[key];
              var branch = isObject(child) && !child.$type;
  
              requestedPath.depth = depth;
  
              var results = setNode(
                  root, parent, node, key, child,
                  branch, false, requestedPath, optimizedPath,
                  version, expired, lru, comparator, errorSelector
              );
  
              requestedPath[depth] = key;
              requestedPath.index = depth;
  
              optimizedPath[optimizedPath.index++] = key;
              var nextNode = results[0];
              var nextParent = results[1];
              if (nextNode) {
                  if (branch) {
                      setPathMap(
                          child, depth + 1,
                          root, nextParent, nextNode,
                          requestedPaths, optimizedPaths, requestedPath, optimizedPath,
                          version, expired, lru, comparator, errorSelector
                      );
                  } else {
                      requestedPaths.push(requestedPath.slice(0, requestedPath.index + 1));
                      optimizedPaths.push(optimizedPath.slice(0, optimizedPath.index));
                  }
              }
              if (++keyIndex >= keyCount) {
                  break;
              }
              optimizedPath.index = optimizedIndex;
          } while (true);
      }
  }
docs: /* eslint-disable no-constant-condition