Sha256: bb9c5efbdb20730de8419cfa633f286213f8c3cde226139373f782c52e737e3a

Contents?: true

Size: 504 Bytes

Versions: 56

Compression:

Stored size: 504 Bytes

Contents

'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;

Version data entries

56 entries across 55 versions & 11 rubygems

Version Path
immosquare-cleaner-0.1.62 node_modules/unicode-match-property-value-ecmascript/index.js
immosquare-cleaner-0.1.61 node_modules/unicode-match-property-value-ecmascript/index.js
immosquare-cleaner-0.1.60 node_modules/unicode-match-property-value-ecmascript/index.js
immosquare-cleaner-0.1.59 node_modules/unicode-match-property-value-ecmascript/index.js
immosquare-cleaner-0.1.58 node_modules/unicode-match-property-value-ecmascript/index.js
immosquare-cleaner-0.1.57 node_modules/unicode-match-property-value-ecmascript/index.js
immosquare-cleaner-0.1.56 node_modules/unicode-match-property-value-ecmascript/index.js
immosquare-cleaner-0.1.55 node_modules/unicode-match-property-value-ecmascript/index.js
immosquare-cleaner-0.1.54 node_modules/unicode-match-property-value-ecmascript/index.js
immosquare-cleaner-0.1.53 node_modules/unicode-match-property-value-ecmascript/index.js
immosquare-cleaner-0.1.52 node_modules/unicode-match-property-value-ecmascript/index.js
immosquare-cleaner-0.1.51 node_modules/unicode-match-property-value-ecmascript/index.js
immosquare-cleaner-0.1.50 node_modules/unicode-match-property-value-ecmascript/index.js
immosquare-cleaner-0.1.49 node_modules/unicode-match-property-value-ecmascript/index.js
immosquare-cleaner-0.1.48 node_modules/unicode-match-property-value-ecmascript/index.js
immosquare-cleaner-0.1.47 node_modules/unicode-match-property-value-ecmascript/index.js
immosquare-cleaner-0.1.46 node_modules/unicode-match-property-value-ecmascript/index.js
immosquare-cleaner-0.1.45 node_modules/unicode-match-property-value-ecmascript/index.js
optimacms-0.1.61 spec/dummy/node_modules/unicode-match-property-value-ecmascript/index.js
disco_app-0.18.0 test/dummy/node_modules/unicode-match-property-value-ecmascript/index.js