code: function _closeSubtree(directory) {
          directory = directory.delete("open");
  
          var children = directory.get("children");
          if (children) {
              children.keySeq().forEach(function (name) {
                  var subdir = children.get(name);
                  if (!isFile(subdir)) {
                      subdir = _closeSubtree(subdir);
                      children = children.set(name, subdir);
                  }
              });
          }
  
          directory = directory.set("children", children);
          return directory;
      }
docs: Closes a subtree path, given by an object path.
  
  @param {Immutable.Map} directory Current directory
  @return {Immutable.Map} new directory