You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
449 B

4 years ago
  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;