Urara-Blog/node_modules/.pnpm-store/v3/files/94/fd6e9d7aaa5f9cbe62f4ef5157c504c9d5f88352b69949d5490718772ce2d67f514a56c1fd748c883e7c5cf0f1b75d62edb4626f15d2f81451b1f38be1597c-exec
2022-08-14 01:14:53 +08:00

19 lines
504 B
Text
Executable file

'use strict';
const propertyToValueAliases = require('./data/mappings.js');
const matchPropertyValue = function(property, value) {
const aliasToValue = propertyToValueAliases.get(property);
if (!aliasToValue) {
throw new Error(`Unknown property \`${ property }\`.`);
}
const canonicalValue = aliasToValue.get(value);
if (canonicalValue) {
return canonicalValue;
}
throw new Error(
`Unknown value \`${ value }\` for property \`${ property }\`.`
);
};
module.exports = matchPropertyValue;