All files / packages/fds-uif/core/src constants.ts

100% Statements 6/6
100% Branches 0/0
100% Functions 0/0
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38              15x     15x     15x     15x     15x           15x                        
/**
 * @fds-uif/core - Constants
 *
 * Centralized constants for UIF processing.
 */
 
/** Marker to remove an inherited array item */
export const MARKER_REMOVE = '$remove' as const;
 
/** Marker to insert before a named sibling */
export const MARKER_BEFORE = '$before' as const;
 
/** Marker to insert after a named sibling */
export const MARKER_AFTER = '$after' as const;
 
/** Property indicating extension relationship */
export const PROP_EXTENDS = 'extends' as const;
 
/** All merge markers that should be stripped from output */
export const MERGE_MARKERS = [MARKER_REMOVE, MARKER_BEFORE, MARKER_AFTER] as const;
 
/**
 * Map of array property names to their identifier fields.
 * Arrays with identifiers use smart merging instead of wholesale replacement.
 */
export const IDENTIFIED_ARRAYS: Readonly<Record<string, string>> = {
  states: 'name',
  modifiers: 'name',
  variants: 'name',
  stateClasses: 'state',
  children: 'name',
  options: 'value', // variant options
  requirements: 'id', // accessibility.requirements
} as const;
 
/** Type for merge marker values */
export type MergeMarker = typeof MARKER_REMOVE | typeof MARKER_BEFORE | typeof MARKER_AFTER;