1. /**
    
  2.  * Copyright (c) Meta Platforms, Inc. and affiliates.
    
  3.  *
    
  4.  * This source code is licensed under the MIT license found in the
    
  5.  * LICENSE file in the root directory of this source tree.
    
  6.  *
    
  7.  * @flow
    
  8.  */
    
  9. 
    
  10. const aliases = new Map([
    
  11.   ['acceptCharset', 'accept-charset'],
    
  12.   ['htmlFor', 'for'],
    
  13.   ['httpEquiv', 'http-equiv'],
    
  14.   // HTML and SVG attributes, but the SVG attribute is case sensitive.],
    
  15.   ['crossOrigin', 'crossorigin'],
    
  16.   // This is a list of all SVG attributes that need special casing.
    
  17.   // Regular attributes that just accept strings.],
    
  18.   ['accentHeight', 'accent-height'],
    
  19.   ['alignmentBaseline', 'alignment-baseline'],
    
  20.   ['arabicForm', 'arabic-form'],
    
  21.   ['baselineShift', 'baseline-shift'],
    
  22.   ['capHeight', 'cap-height'],
    
  23.   ['clipPath', 'clip-path'],
    
  24.   ['clipRule', 'clip-rule'],
    
  25.   ['colorInterpolation', 'color-interpolation'],
    
  26.   ['colorInterpolationFilters', 'color-interpolation-filters'],
    
  27.   ['colorProfile', 'color-profile'],
    
  28.   ['colorRendering', 'color-rendering'],
    
  29.   ['dominantBaseline', 'dominant-baseline'],
    
  30.   ['enableBackground', 'enable-background'],
    
  31.   ['fillOpacity', 'fill-opacity'],
    
  32.   ['fillRule', 'fill-rule'],
    
  33.   ['floodColor', 'flood-color'],
    
  34.   ['floodOpacity', 'flood-opacity'],
    
  35.   ['fontFamily', 'font-family'],
    
  36.   ['fontSize', 'font-size'],
    
  37.   ['fontSizeAdjust', 'font-size-adjust'],
    
  38.   ['fontStretch', 'font-stretch'],
    
  39.   ['fontStyle', 'font-style'],
    
  40.   ['fontVariant', 'font-variant'],
    
  41.   ['fontWeight', 'font-weight'],
    
  42.   ['glyphName', 'glyph-name'],
    
  43.   ['glyphOrientationHorizontal', 'glyph-orientation-horizontal'],
    
  44.   ['glyphOrientationVertical', 'glyph-orientation-vertical'],
    
  45.   ['horizAdvX', 'horiz-adv-x'],
    
  46.   ['horizOriginX', 'horiz-origin-x'],
    
  47.   ['imageRendering', 'image-rendering'],
    
  48.   ['letterSpacing', 'letter-spacing'],
    
  49.   ['lightingColor', 'lighting-color'],
    
  50.   ['markerEnd', 'marker-end'],
    
  51.   ['markerMid', 'marker-mid'],
    
  52.   ['markerStart', 'marker-start'],
    
  53.   ['overlinePosition', 'overline-position'],
    
  54.   ['overlineThickness', 'overline-thickness'],
    
  55.   ['paintOrder', 'paint-order'],
    
  56.   ['panose-1', 'panose-1'],
    
  57.   ['pointerEvents', 'pointer-events'],
    
  58.   ['renderingIntent', 'rendering-intent'],
    
  59.   ['shapeRendering', 'shape-rendering'],
    
  60.   ['stopColor', 'stop-color'],
    
  61.   ['stopOpacity', 'stop-opacity'],
    
  62.   ['strikethroughPosition', 'strikethrough-position'],
    
  63.   ['strikethroughThickness', 'strikethrough-thickness'],
    
  64.   ['strokeDasharray', 'stroke-dasharray'],
    
  65.   ['strokeDashoffset', 'stroke-dashoffset'],
    
  66.   ['strokeLinecap', 'stroke-linecap'],
    
  67.   ['strokeLinejoin', 'stroke-linejoin'],
    
  68.   ['strokeMiterlimit', 'stroke-miterlimit'],
    
  69.   ['strokeOpacity', 'stroke-opacity'],
    
  70.   ['strokeWidth', 'stroke-width'],
    
  71.   ['textAnchor', 'text-anchor'],
    
  72.   ['textDecoration', 'text-decoration'],
    
  73.   ['textRendering', 'text-rendering'],
    
  74.   ['transformOrigin', 'transform-origin'],
    
  75.   ['underlinePosition', 'underline-position'],
    
  76.   ['underlineThickness', 'underline-thickness'],
    
  77.   ['unicodeBidi', 'unicode-bidi'],
    
  78.   ['unicodeRange', 'unicode-range'],
    
  79.   ['unitsPerEm', 'units-per-em'],
    
  80.   ['vAlphabetic', 'v-alphabetic'],
    
  81.   ['vHanging', 'v-hanging'],
    
  82.   ['vIdeographic', 'v-ideographic'],
    
  83.   ['vMathematical', 'v-mathematical'],
    
  84.   ['vectorEffect', 'vector-effect'],
    
  85.   ['vertAdvY', 'vert-adv-y'],
    
  86.   ['vertOriginX', 'vert-origin-x'],
    
  87.   ['vertOriginY', 'vert-origin-y'],
    
  88.   ['wordSpacing', 'word-spacing'],
    
  89.   ['writingMode', 'writing-mode'],
    
  90.   ['xmlnsXlink', 'xmlns:xlink'],
    
  91.   ['xHeight', 'x-height'],
    
  92. ]);
    
  93. 
    
  94. export default function (name: string): string {
    
  95.   return aliases.get(name) || name;
    
  96. }