@terraforge/terraform 0.0.27 → 0.0.28
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/dist/index.mjs +9 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -315,9 +315,17 @@ const hasInputValue = (value) => typeof value !== "undefined";
|
|
|
315
315
|
const shouldIncludeFieldForComparison = (schema, inputValue) => {
|
|
316
316
|
return schema.required || hasInputValue(inputValue);
|
|
317
317
|
};
|
|
318
|
+
const isContainerSchema = (schema) => {
|
|
319
|
+
return [
|
|
320
|
+
"array",
|
|
321
|
+
"record",
|
|
322
|
+
"object",
|
|
323
|
+
"array-object"
|
|
324
|
+
].includes(schema.type);
|
|
325
|
+
};
|
|
318
326
|
const normalizeStateForComparison = (schema, state, inputState) => {
|
|
319
327
|
if (!shouldIncludeFieldForComparison(schema, inputState)) return;
|
|
320
|
-
if ((
|
|
328
|
+
if ((state === null || typeof state === "undefined") && isContainerSchema(schema) && isEmptyOutputValue(inputState)) state = inputState;
|
|
321
329
|
if (state === null || typeof state === "undefined") return state;
|
|
322
330
|
if (schema.type === "array") {
|
|
323
331
|
if (!Array.isArray(state)) return state;
|