function addPatternItem(patternlab, pattern, isViewAllVariant) {
    const patternGroup = getPatternGroup(patternlab, pattern);
    if (!patternGroup) {
      logger.error(
        `Could not find patternGroup ${pattern.patternGroup}. This is a critical error.`
      );
    }

    patternGroup.patternItems = patternGroup.patternItems || [];
    if (isViewAllVariant) {
      patternGroup.patternItems.push({
        patternPartial: `viewall-${pattern.patternGroup}-all`,
        patternName: `View all ${_.startCase(pattern.patternGroup)}`,
        patternPath: encodeURI(pattern.patternGroup + '/index.html'),
        name: pattern.patternGroup,
        isDocPattern: true,
        order: Number.MAX_SAFE_INTEGER, // Or pattern.groupData.order
      });
    } else {
      patternGroup.patternItems.push(createPatternSubgroupItem(pattern));
    }
    patternGroup.patternItems = getSortedPatterns(patternGroup.patternItems);
  }
/**
   * Registers flat patterns to the appropriate type
   * @param patternlab - global data store
   * @param pattern - the pattern to add
   */
Registers flat patterns to the appropriate type
@param patternlab - global data store
@param pattern - the pattern to add
Registers flat patterns to the appropriate type @param patternlab - global data store @param pattern - the pattern to add
function addPatternItem(patternlab, pattern, isViewAllVariant) {
    const patternGroup = getPatternGroup(patternlab, pattern);
    if (!patternGroup) {
      logger.error(
        `Could not find patternGroup ${pattern.patternGroup}. This is a critical error.`
      );
    }
    patternGroup.patternItems = patternGroup.patternItems || [];
    if (isViewAllVariant) {
      patternGroup.patternItems.push({
        patternPartial: `viewall-${pattern.patternGroup}-all`,
        patternName: `View all ${_.startCase(pattern.patternGroup)}`,
        patternPath: encodeURI(pattern.patternGroup + '/index.html'),
        name: pattern.patternGroup,
        isDocPattern: true,
        order: Number.MAX_SAFE_INTEGER, 
      });
    } else {
      patternGroup.patternItems.push(createPatternSubgroupItem(pattern));
    }
    patternGroup.patternItems = getSortedPatterns(patternGroup.patternItems);
  }
function addPatternItem ( patternlab , pattern , isViewAllVariant ) { const patternGroup = getPatternGroup ( patternlab , pattern ) ; if ( ! patternGroup ) { logger . error ( ` ${ pattern . patternGroup } ` ) ; } patternGroup . patternItems = patternGroup . patternItems || [ ] ; if ( isViewAllVariant ) { patternGroup . patternItems . push ( { patternPartial : ` ${ pattern . patternGroup } ` , patternName : ` ${ _ . startCase ( pattern . patternGroup ) } ` , patternPath : encodeURI ( pattern . patternGroup + '/index.html' ) , name : pattern . patternGroup , isDocPattern : true , order : Number . MAX_SAFE_INTEGER , } ) ; } else { patternGroup . patternItems . push ( createPatternSubgroupItem ( pattern ) ) ; } patternGroup . patternItems = getSortedPatterns ( patternGroup . patternItems ) ; }
Registers flat patterns to the appropriate type
 @param patternlab - global data store
 @param pattern - the pattern to add
Registers flat patterns to the appropriate type @param patternlab - global data store @param pattern - the pattern to add
// Or pattern.groupData.order