parseLine: remove line.class & line.productCode 💥

This commit is contained in:
Jannis R 2018-12-10 20:42:37 +01:00
parent 3bc2eff530
commit a1ffad3071
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5

View file

@ -26,15 +26,11 @@ const createParseLine = (profile, opt, {operators}) => {
public: true
}
// todo: what is p.number?
// todo: what is p.prodCtx.catCode?
if (p.cls) res.class = p.cls
if (p.prodCtx && p.prodCtx.catCode !== undefined) {
res.productCode = +p.prodCtx.catCode
}
if ('class' in res) {
// todo: what if `res.class` is the sum of two bitmasks?
const product = byBitmask[parseInt(res.class)]
if ('cls' in p) {
// todo: what if `p.cls` is the sum of two bitmasks?
const product = byBitmask[parseInt(p.cls)]
res.mode = product && product.mode || null
res.product = product && product.id || null
}