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.

27 lines
725 B
JavaScript

"use strict";
const htmlEntities = require("html-entities");
const pickBestOption = require("../../shared/pick-best-option");
module.exports = function normalizeProduct() {
return async function ({ data, createItem }) {
let manufacturer = "STMicroelectronics";
let modelName = data.cellData["XJE010_VT-007"];
let description = htmlEntities.decode(data.cellData["XJE014_VT-007"]);
let url = data.datasheetLink;
let productID = data.productId;
createItem({
id: `datasheet:${manufacturer}:${modelName}`,
update: (data) => pickBestOption(data, {
priority: 0.8,
manufacturer: manufacturer,
productID: productID,
name: modelName,
description: description,
url: url
})
});
};
};