function addPatternSubgroupItem(
    patternlab,
    pattern,
    createSubgroupViewAllVariant
  ) {
    let newSubgroupItem;

    if (createSubgroupViewAllVariant) {
      newSubgroupItem = {
        patternPartial:
          'viewall-' + pattern.patternGroup + '-' + pattern.patternSubgroup,
        patternName: `View All`,
        patternPath: encodeURI(pattern.flatPatternPath + '/index.html'),
        patternGroup: pattern.patternGroup,
        patternSubgroup: pattern.patternSubgroup,
        name: pattern.flatPatternPath,
        isDocPattern: true,
        order: Number.MAX_SAFE_INTEGER,
      };
    } else {
      newSubgroupItem = createPatternSubgroupItem(pattern);
    }

    const patternSubgroup = getPatternSubgroup(patternlab, pattern);
    patternSubgroup.patternSubgroupItems.push(newSubgroupItem);
    patternSubgroup.patternSubgroupItems = getSortedPatterns(
      patternSubgroup.patternSubgroupItems
    );
  }
/**
   * Registers the pattern with the appropriate patternGroup.patternSubgroup.patternSubgroupItems array
   * These are the actual menu items you click on
   * @param patternlab - global data store
   * @param pattern - the pattern to derive the subgroupitem from
   * @param createViewAllVariant - whether or not to create the special view all item
   */
Registers the pattern with the appropriate patternGroup.patternSubgroup.patternSubgroupItems array
These are the actual menu items you click on
@param patternlab - global data store
@param pattern - the pattern to derive the subgroupitem from
@param createViewAllVariant - whether or not to create the special view all item
Registers the pattern with the appropriate patternGroup . patternSubgroup . patternSubgroupItems array These are the actual menu items you click on @param patternlab - global data store @param pattern - the pattern to derive the subgroupitem from @param createViewAllVariant - whether or not to create the special view all item
function addPatternSubgroupItem(
    patternlab,
    pattern,
    createSubgroupViewAllVariant
  ) {
    let newSubgroupItem;
    if (createSubgroupViewAllVariant) {
      newSubgroupItem = {
        patternPartial:
          'viewall-' + pattern.patternGroup + '-' + pattern.patternSubgroup,
        patternName: `View All`,
        patternPath: encodeURI(pattern.flatPatternPath + '/index.html'),
        patternGroup: pattern.patternGroup,
        patternSubgroup: pattern.patternSubgroup,
        name: pattern.flatPatternPath,
        isDocPattern: true,
        order: Number.MAX_SAFE_INTEGER,
      };
    } else {
      newSubgroupItem = createPatternSubgroupItem(pattern);
    }
    const patternSubgroup = getPatternSubgroup(patternlab, pattern);
    patternSubgroup.patternSubgroupItems.push(newSubgroupItem);
    patternSubgroup.patternSubgroupItems = getSortedPatterns(
      patternSubgroup.patternSubgroupItems
    );
  }
function addPatternSubgroupItem ( patternlab , pattern , createSubgroupViewAllVariant ) { let newSubgroupItem ; if ( createSubgroupViewAllVariant ) { newSubgroupItem = { patternPartial : 'viewall-' + pattern . patternGroup + '-' + pattern . patternSubgroup , patternName : ` ` , patternPath : encodeURI ( pattern . flatPatternPath + '/index.html' ) , patternGroup : pattern . patternGroup , patternSubgroup : pattern . patternSubgroup , name : pattern . flatPatternPath , isDocPattern : true , order : Number . MAX_SAFE_INTEGER , } ; } else { newSubgroupItem = createPatternSubgroupItem ( pattern ) ; } const patternSubgroup = getPatternSubgroup ( patternlab , pattern ) ; patternSubgroup . patternSubgroupItems . push ( newSubgroupItem ) ; patternSubgroup . patternSubgroupItems = getSortedPatterns ( patternSubgroup . patternSubgroupItems ) ; }
Registers the pattern with the appropriate patternGroup.patternSubgroup.patternSubgroupItems array
 These are the actual menu items you click on
 @param patternlab - global data store
 @param pattern - the pattern to derive the subgroupitem from
 @param createViewAllVariant - whether or not to create the special view all item
Registers the pattern with the appropriate patternGroup . patternSubgroup . patternSubgroupItems array These are the actual menu items you click on @param patternlab - global data store @param pattern - the pattern to derive the subgroupitem from @param createViewAllVariant - whether or not to create the special view all item