speculate
Advanced tools
Comparing version 2.0.0-alpha.1 to 2.0.0-alpha.2
'use strict'; | ||
const _ = require('lodash'); | ||
const tar = require('tar-fs'); | ||
@@ -17,11 +16,18 @@ const fs = require('fs'); | ||
if (whitelist.files) { | ||
const whitelistSections = _.pick(whitelist, ['main', 'files']); | ||
const whitelistFromSections = _.reduce(whitelistSections, (whitelist, current) => { | ||
if (current) { | ||
return _.concat(whitelist, current); | ||
} | ||
// Extract the property from the whitelist | ||
const { main, files } = whitelist; | ||
const whitelistFromSections = []; | ||
return whitelist; | ||
}, []); | ||
/* | ||
* It flattens the content of both properties (main and files) in the | ||
* "whitelistFromSections" array. | ||
*/ | ||
if (main) { | ||
whitelistFromSections.push(main); | ||
} | ||
if (files) { | ||
whitelistFromSections.push(...files); | ||
} | ||
if (!whitelistFromSections.length) { | ||
@@ -31,3 +37,3 @@ return; | ||
return _.concat(REQUIRED_ENTRIES, whitelistFromSections); | ||
return REQUIRED_ENTRIES.concat(whitelistFromSections); | ||
} | ||
@@ -34,0 +40,0 @@ } |
{ | ||
"name": "speculate", | ||
"version": "2.0.0-alpha.1", | ||
"version": "2.0.0-alpha.2", | ||
"description": "Automatically generates an RPM Spec file for your Node.js project", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
54045
897