form0-core 0.1.24 → 0.1.25

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "form0-core",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/"
6
6
  },
@@ -8,7 +8,7 @@
8
8
  "main": "src/index.js",
9
9
  "type": "module",
10
10
  "scripts": {
11
- "test": "node tests/form0-core.test.js && node tests/dataset-descriptors.test.js && node tests/structured-record.test.js && node tests/builtin-metadata.test.js && node tests/calculation-editor.test.js && node tests/form-event-editor.test.js && node tests/security-test.js",
11
+ "test": "node tests/form0-core.test.js && node tests/numeric-field-schema.test.js && node tests/dataset-descriptors.test.js && node tests/structured-record.test.js && node tests/builtin-metadata.test.js && node tests/calculation-editor.test.js && node tests/form-event-editor.test.js && node tests/security-test.js",
12
12
  "format": "prettier --write \"**/*.{js,jsx,json,ts,tsx,md}\"",
13
13
  "format:check": "prettier --check \"**/*.{js,jsx,json,ts,tsx,md}\""
14
14
  },
@@ -202,7 +202,10 @@ export const FIELD_SPECS = {
202
202
  schemaValidators: [
203
203
  // Validate min/max relationship (cross-attribute validation)
204
204
  (field) => {
205
- if (field.min !== undefined && field.max !== undefined && field.min > field.max) {
205
+ const hasMin = field.min !== null && field.min !== undefined;
206
+ const hasMax = field.max !== null && field.max !== undefined;
207
+
208
+ if (hasMin && hasMax && field.min > field.max) {
206
209
  return { isValid: false, error: `NumericField "${field.data_name}" has min > max` };
207
210
  }
208
211
  return { isValid: true };