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

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

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 39 40 41 42 43 44 45 46 47 48              24x     24x     24x     24x     24x     24x     24x           24x                                
/**
 * @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;
 
/** Marker to wrap named siblings inside a new parent node */
export const MARKER_WRAP = '$wrap' as const;
 
/** Property indicating extension relationship */
export const PROP_EXTENDS = 'extends' as const;
 
/** Property for namespaced third-party metadata */
export const PROP_EXTENSIONS = 'extensions' as const;
 
/** All merge markers that should be stripped from output */
export const MERGE_MARKERS = [MARKER_REMOVE, MARKER_BEFORE, MARKER_AFTER, MARKER_WRAP] 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
  | typeof MARKER_WRAP;