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.
17 lines
449 B
17 lines
449 B
2 years ago
|
'use strict';
|
||
|
|
||
|
const canonicalProperties = require('unicode-canonical-property-names-ecmascript');
|
||
|
const propertyAliases = require('unicode-property-aliases-ecmascript');
|
||
|
|
||
|
const matchProperty = function(property) {
|
||
|
if (canonicalProperties.has(property)) {
|
||
|
return property;
|
||
|
}
|
||
|
if (propertyAliases.has(property)) {
|
||
|
return propertyAliases.get(property);
|
||
|
}
|
||
|
throw new Error(`Unknown property: ${ property }`);
|
||
|
};
|
||
|
|
||
|
module.exports = matchProperty;
|