s3db.js 4.1.1 → 4.1.2

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/s3db.iife.js CHANGED
@@ -9598,20 +9598,13 @@ ${JSON.stringify(validation, null, 2)}`
9598
9598
  * @returns {string} SHA256 hash of the schema definition
9599
9599
  */
9600
9600
  getDefinitionHash() {
9601
- const exportedSchema = this.schema.export();
9602
- const stableSchema = {
9603
- ...exportedSchema,
9604
- attributes: { ...exportedSchema.attributes }
9605
- };
9601
+ const attributes = this.schema.export().attributes;
9602
+ const stableAttributes = { ...attributes };
9606
9603
  if (this.options.timestamps) {
9607
- delete stableSchema.attributes.createdAt;
9608
- delete stableSchema.attributes.updatedAt;
9609
- if (stableSchema.options && stableSchema.options.partitions) {
9610
- delete stableSchema.options.partitions.byCreatedDate;
9611
- delete stableSchema.options.partitions.byUpdatedDate;
9612
- }
9604
+ delete stableAttributes.createdAt;
9605
+ delete stableAttributes.updatedAt;
9613
9606
  }
9614
- const stableString = jsonStableStringify(stableSchema);
9607
+ const stableString = jsonStableStringify(stableAttributes);
9615
9608
  return `sha256:${crypto.createHash("sha256").update(stableString).digest("hex")}`;
9616
9609
  }
9617
9610
  /**
@@ -9805,7 +9798,7 @@ ${JSON.stringify(validation, null, 2)}`
9805
9798
  this.version = "1";
9806
9799
  this.s3dbVersion = (() => {
9807
9800
  try {
9808
- return true ? "4.1.0" : "latest";
9801
+ return true ? "4.1.1" : "latest";
9809
9802
  } catch (e) {
9810
9803
  return "latest";
9811
9804
  }
@@ -9920,7 +9913,13 @@ ${JSON.stringify(validation, null, 2)}`
9920
9913
  * @returns {string} SHA256 hash
9921
9914
  */
9922
9915
  generateDefinitionHash(definition) {
9923
- const stableString = jsonStableStringify(definition);
9916
+ const attributes = definition.attributes;
9917
+ const stableAttributes = { ...attributes };
9918
+ if (definition.options?.timestamps) {
9919
+ delete stableAttributes.createdAt;
9920
+ delete stableAttributes.updatedAt;
9921
+ }
9922
+ const stableString = jsonStableStringify(stableAttributes);
9924
9923
  return `sha256:${crypto.createHash("sha256").update(stableString).digest("hex")}`;
9925
9924
  }
9926
9925
  /**