hast-to-react.js 859 B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * Special cases for React (`Record<string, string>`).
  3. *
  4. * `hast` is close to `React` but differs in a couple of cases.
  5. * To get a React property from a hast property,
  6. * check if it is in `hastToReact`.
  7. * If it is, use the corresponding value;
  8. * otherwise, use the hast property.
  9. *
  10. * @type {Record<string, string>}
  11. */
  12. export const hastToReact = {
  13. classId: 'classID',
  14. dataType: 'datatype',
  15. itemId: 'itemID',
  16. strokeDashArray: 'strokeDasharray',
  17. strokeDashOffset: 'strokeDashoffset',
  18. strokeLineCap: 'strokeLinecap',
  19. strokeLineJoin: 'strokeLinejoin',
  20. strokeMiterLimit: 'strokeMiterlimit',
  21. typeOf: 'typeof',
  22. xLinkActuate: 'xlinkActuate',
  23. xLinkArcRole: 'xlinkArcrole',
  24. xLinkHref: 'xlinkHref',
  25. xLinkRole: 'xlinkRole',
  26. xLinkShow: 'xlinkShow',
  27. xLinkTitle: 'xlinkTitle',
  28. xLinkType: 'xlinkType',
  29. xmlnsXLink: 'xmlnsXlink'
  30. }