Skip to content

Commit 0f57303

Browse files
committed
false task config being overwritten by empty array resulting in task being performed
1 parent 2dbdaee commit 0f57303

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [1.6.1] - 2022-10-21
8+
### Fixed
9+
- `false` task config being overwritten by empty array resulting in task being performed
10+
711
## [1.6.0] - 2022-06-20
812
### Updated
913
- gulp-sass to use latest node-sass version

lib/get-config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ function getTaskConfig (...path) {
8585
* @protected
8686
*/
8787
function itterateConfig (config, fn) {
88+
if (config === false) return false;
8889
const base = isPlainObject(config) ? {} : [];
8990

9091
return reduce(config, (object, value, key) => {
@@ -111,7 +112,13 @@ function itterateConfig (config, fn) {
111112
function mergeConfigMode (config) {
112113
if ('production' in config || 'development' in config) {
113114
const mode = global.production ? 'production' : 'development';
114-
return omit(merge(config, config[mode]), ['production', 'development']);
115+
const value = merge(config, config[mode]);
116+
117+
if (value !== false) {
118+
return omit(value, ['production', 'development']);
119+
} else {
120+
return value;
121+
}
115122
} else {
116123
return config;
117124
}

lib/merge.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ function customizer (objValue, srcValue, key) {
1717
*/
1818
module.exports = function merge (object, ...sources) {
1919
for (let i = 0; i < sources.length; i++) {
20-
object = mergeWith(object, sources[i], customizer);
20+
if (sources[i] && typeof sources[i] === 'object') {
21+
object = mergeWith(object, sources[i], customizer);
22+
} else {
23+
object = sources[i];
24+
}
2125
}
2226
return object;
2327
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@videinfra/static-website-builder",
3-
"version": "1.6.0",
3+
"version": "1.6.1",
44
"description": "Customizable static site project builder",
55
"license": "MIT",
66
"engines": {

0 commit comments

Comments
 (0)