@streamscloud/kit 0.81.1 → 0.82.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.
@@ -1,10 +1,10 @@
1
1
  import { ValidationLocalization } from './validation-localization';
2
2
  import * as yup from 'yup';
3
3
  const resolveMinBound = (rules) => {
4
- return rules.minValue === null ? null : rules.minExclusive ? rules.minValue + 1 : rules.minValue;
4
+ return rules.min === null ? null : rules.minExclusive ? rules.min + 1 : rules.min;
5
5
  };
6
6
  const resolveMaxBound = (rules) => {
7
- return rules.maxValue === null ? null : rules.maxExclusive ? rules.maxValue - 1 : rules.maxValue;
7
+ return rules.max === null ? null : rules.maxExclusive ? rules.max - 1 : rules.max;
8
8
  };
9
9
  /** Value-level rules of `numberValidationSchema`. Judges a real value — `null` / `undefined` are decided by the schema modifiers the caller adds. */
10
10
  export const isValidNumber = (value, rules) => {
@@ -16,14 +16,17 @@ export type UrlValidation = {
16
16
  allowLocalHosts?: boolean;
17
17
  };
18
18
  export type NumberValidation = {
19
- minValue: number | null;
20
- maxValue: number | null;
21
- minExclusive: boolean;
22
- maxExclusive: boolean;
19
+ min: number | null;
20
+ max: number | null;
21
+ /** Integer bound: an exclusive min is resolved to `min + 1`. @default false */
22
+ minExclusive?: boolean;
23
+ /** Integer bound: an exclusive max is resolved to `max - 1`. @default false */
24
+ maxExclusive?: boolean;
23
25
  };
24
26
  export type MinNumberValidation = {
25
- minValue: number | null;
26
- minExclusive: boolean;
27
+ min: number | null;
28
+ /** Integer bound: an exclusive min is resolved to `min + 1`. @default false */
29
+ minExclusive?: boolean;
27
30
  };
28
31
  export type ArrayValidation = {
29
32
  minItems: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/kit",
3
- "version": "0.81.1",
3
+ "version": "0.82.0",
4
4
  "author": "StreamsCloud",
5
5
  "repository": {
6
6
  "type": "git",