From 26105034da4fcce7ac883c899d781f016559310d Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 8 Nov 2018 00:38:48 +0800 Subject: switch to vuepress --- .../unicode-match-property-value-ecmascript/index.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 node_modules/unicode-match-property-value-ecmascript/index.js (limited to 'node_modules/unicode-match-property-value-ecmascript/index.js') diff --git a/node_modules/unicode-match-property-value-ecmascript/index.js b/node_modules/unicode-match-property-value-ecmascript/index.js new file mode 100755 index 00000000..ca8b991d --- /dev/null +++ b/node_modules/unicode-match-property-value-ecmascript/index.js @@ -0,0 +1,19 @@ +'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; -- cgit v1.2.3