Skip to content

Commit

Permalink
parseLine: remove line.class & line.productCode 💥
Browse files Browse the repository at this point in the history
  • Loading branch information
derhuerst committed Dec 10, 2018
1 parent 4ed2436 commit 8dd4ef5
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions parse/line.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 8dd4ef5

Please sign in to comment.