source: imaps-frontend/node_modules/unicode-match-property-value-ecmascript/index.js

main
Last change on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago

F4 Finalna Verzija

  • Property mode set to 100755
File size: 504 bytes
RevLine 
[79a0317]1'use strict';
2
3const propertyToValueAliases = require('./data/mappings.js');
4
5const matchPropertyValue = function(property, value) {
6 const aliasToValue = propertyToValueAliases.get(property);
7 if (!aliasToValue) {
8 throw new Error(`Unknown property \`${ property }\`.`);
9 }
10 const canonicalValue = aliasToValue.get(value);
11 if (canonicalValue) {
12 return canonicalValue;
13 }
14 throw new Error(
15 `Unknown value \`${ value }\` for property \`${ property }\`.`
16 );
17};
18
19module.exports = matchPropertyValue;
Note: See TracBrowser for help on using the repository browser.