@netlify/config 17.0.9 → 17.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/simplify.js +10 -2
package/package.json
CHANGED
package/src/simplify.js
CHANGED
|
@@ -33,8 +33,8 @@ export const simplifyConfig = function ({
|
|
|
33
33
|
...removeEmptyObject(simplifyFunctions(functions), 'functions'),
|
|
34
34
|
...removeEmptyObject(buildA, 'build'),
|
|
35
35
|
...removeEmptyArray(plugins, 'plugins'),
|
|
36
|
-
...removeEmptyArray(headers, 'headers'),
|
|
37
|
-
...removeEmptyArray(simplifyRedirects(redirects), 'redirects'),
|
|
36
|
+
...removeEmptyArray(truncateArray(headers), 'headers'),
|
|
37
|
+
...removeEmptyArray(simplifyRedirects(truncateArray(redirects)), 'redirects'),
|
|
38
38
|
...removeEmptyObject(simplifyContexts(context), 'context'),
|
|
39
39
|
})
|
|
40
40
|
}
|
|
@@ -85,6 +85,14 @@ const removeDefaultValue = function (value, propName, defaultValue) {
|
|
|
85
85
|
return value === defaultValue ? {} : { [propName]: value }
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
+
// `headers` and `redirects` can be very long, which can take several minutes
|
|
89
|
+
// to print in the build logs. We truncate them before logging.
|
|
90
|
+
const truncateArray = function (array) {
|
|
91
|
+
return !Array.isArray(array) || array.length < MAX_ARRAY_LENGTH ? array : array.slice(0, MAX_ARRAY_LENGTH)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const MAX_ARRAY_LENGTH = 100
|
|
95
|
+
|
|
88
96
|
export const removeEmptyObject = function (object, propName) {
|
|
89
97
|
if (!isPlainObj(object)) {
|
|
90
98
|
return {}
|