Replace flatMap method with reduce and map

This commit is contained in:
kumaran-14
2020-04-13 22:36:33 +05:30
parent df7ba37d57
commit 1f4b2607cc
+1 -1
View File
@@ -21,7 +21,7 @@ let flagArgs = [];
if (process.argv.length > 2) {
const args = process.argv.slice(2);
flagArgs = args.filter(e => e.startsWith('--')).flatMap(arg => arg.split('='));
flagArgs = args.filter(e => e.startsWith('--')).map(arg => arg.split('=')).reduce((arr, val) => arr.concat([...val], []));
console.info(flagArgs);
// ability to inject particular test files via
// yarn test [testFileA testFileB ...]