From 7b693950fc4b48ece6ef1b132f779eccc1428407 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Fri, 12 Aug 2016 17:41:28 +0200 Subject: [PATCH] fix product parsing :bug: --- parse.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/parse.js b/parse.js index 11c254a2..583b1517 100644 --- a/parse.js +++ b/parse.js @@ -35,15 +35,15 @@ const location = (l) => { // todo: what is p.number vs p.line? // todo: what is p.icoX? -// todo: what is p.cls? // todo: what is p.oprX? const product = (p) => { - if (p.prodCtx) p = p.prodCtx if (!p) return null - return { - name: p.name, nr: +p.number, class: p.cls, - productCode: +p.prodCtx.catCode, productName: p.prodCtx.catOutS + const result = {line: p.line, class: p.cls} + if (p.prodCtx) { + result.productCode = +p.prodCtx.catCode + result.productName = p.prodCtx.catOutS } + return result }