index.js 449 B

1234567891011121314151617
  1. 'use strict';
  2. const canonicalProperties = require('unicode-canonical-property-names-ecmascript');
  3. const propertyAliases = require('unicode-property-aliases-ecmascript');
  4. const matchProperty = function(property) {
  5. if (canonicalProperties.has(property)) {
  6. return property;
  7. }
  8. if (propertyAliases.has(property)) {
  9. return propertyAliases.get(property);
  10. }
  11. throw new Error(`Unknown property: ${ property }`);
  12. };
  13. module.exports = matchProperty;