@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.
Files changed (2) hide show
  1. package/dist/index.mjs +9 -1
  2. 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 ((schema.optional || schema.computed) && (state === null || typeof state === "undefined") && isEmptyOutputValue(inputState)) state = inputState;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@terraforge/terraform",
3
- "version": "0.0.27",
3
+ "version": "0.0.28",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",