jedison 1.21.0 → 1.22.0

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.
@@ -3110,8 +3110,19 @@ class InstanceObject extends Instance {
3110
3110
  if (!isReq && isRecursive) {
3111
3111
  musstCreateChild = false;
3112
3112
  }
3113
+ const defaultProperties = getSchemaXOption(this.schema, "defaultProperties");
3114
+ const hasDefaultProperties = isArray(defaultProperties);
3115
+ const propertyDefaultProperty = getSchemaXOption(schema, "defaultProperty");
3116
+ const hasPropertyDefaultProperty = isSet(propertyDefaultProperty);
3117
+ const isDefaultProperty = hasPropertyDefaultProperty ? propertyDefaultProperty === true : hasDefaultProperties && defaultProperties.includes(key);
3118
+ if (!isReq && (hasDefaultProperties || hasPropertyDefaultProperty) && !isDefaultProperty) {
3119
+ musstCreateChild = false;
3120
+ }
3121
+ if (!isReq && !isRecursive && isDefaultProperty) {
3122
+ musstCreateChild = true;
3123
+ }
3113
3124
  if (musstCreateChild) {
3114
- this.createChild(schema, key, hasOwn(initialValue, key) ? initialValue[key] : void 0);
3125
+ this.createChild(schema, key, hasOwn(initialValue, key) ? initialValue[key] : void 0, isDefaultProperty);
3115
3126
  }
3116
3127
  });
3117
3128
  }
@@ -7462,7 +7473,7 @@ class JsonWalker {
7462
7473
  }
7463
7474
  }
7464
7475
  }
7465
- const version = "1.21.0";
7476
+ const version = "1.22.0";
7466
7477
  class Jedison extends EventEmitter {
7467
7478
  /**
7468
7479
  * Creates a Jedison instance.