You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
437 B
JavaScript

"use strict";
const mapObject = require("map-obj");
const matchValue = require("match-value");
const mapping = require("./mapping");
let normalizedMapping = mapObject(mapping, (key, value) => {
return [ key.toLowerCase(), value ];
});
module.exports = function mapManufacturer(manufacturer) {
return (manufacturer != null)
? matchValue(manufacturer.toLowerCase(), {
... normalizedMapping,
_: manufacturer
})
: null;
};