From 9e504d1319fc60698fac0955fa5336986cd14985 Mon Sep 17 00:00:00 2001 From: Andrew Prentice Date: Thu, 11 Aug 2016 12:54:31 -0400 Subject: [PATCH] fix(onelook): extract strings from arrays parsed object has single strings in arrays Close #4 Onelook resource links option broken --- src/cmds/onelook.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cmds/onelook.js b/src/cmds/onelook.js index aab718b..622de73 100644 --- a/src/cmds/onelook.js +++ b/src/cmds/onelook.js @@ -122,11 +122,13 @@ exports.handler = (argv) => { themes.label(theme, 'down', 'Resources') for (let i = 0; i <= resources.length - 1; i++) { const item = resources[i] - const res = item.OLResName.replace(/\n/g, '') - const link = item.OLResLink.replace(/\n/g, '') + const res = tools.arrToStr(item.OLResName).replace(/\n/g, '') + const link = tools.arrToStr(item.OLResLink).replace(/\n/g, '') + const home = tools.arrToStr(item.OLResHomeLink).replace(/\n/g, '') themes.label(theme, 'right', res, link) tofile[[`res${i}`]] = res tofile[[`link${i}`]] = link + tofile[[`home${i}`]] = home } } if (argv.o) tools.outFile(argv.o, argv.f, tofile)