s3db.js 3.2.0 → 3.2.1

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.cjs.js CHANGED
@@ -1336,9 +1336,9 @@ const SchemaActions = {
1336
1336
  toString: (value) => String(value),
1337
1337
  fromArray: (value, { separator }) => (value || []).join(separator),
1338
1338
  toArray: (value, { separator }) => (value || "").split(separator),
1339
- toNumber: (value) => lodashEs.isString(value) ? value.includes(".") ? parseFloat(value) : parseInt(value) : value,
1340
1339
  toJSON: (value) => JSON.stringify(value),
1341
- fromJSON: (value) => JSON.parse(value)
1340
+ fromJSON: (value) => JSON.parse(value),
1341
+ toNumber: (value) => lodashEs.isString(value) ? value.includes(".") ? parseFloat(value) : parseInt(value) : value
1342
1342
  };
1343
1343
  class Schema {
1344
1344
  constructor(args) {
@@ -1407,8 +1407,8 @@ class Schema {
1407
1407
  this.addHook("afterUnmap", name, "toNumber");
1408
1408
  }
1409
1409
  if (definition.includes("boolean")) {
1410
- this.addHook("beforeMap", name, "toJson");
1411
- this.addHook("afterUnmap", name, "fromJson");
1410
+ this.addHook("beforeMap", name, "toJSON");
1411
+ this.addHook("afterUnmap", name, "fromJSON");
1412
1412
  }
1413
1413
  }
1414
1414
  }