@stacksjs/validation 0.75.519 → 0.75.522

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,4 @@
1
1
  import type { Validator } from '@stacksjs/ts-validation';
2
- // Shared by every augmented validator, so each call to withConditionals
3
- // assigns these two functions instead of allocating new closures. Generic
4
- // over the validator they are bound to, so they are assignable to the
5
- // methods of each augmented type without a cast.
6
- declare function when<V extends Validator<any>>(this: ConditionalValidator<V>, field: string, match: unknown | ((value: unknown) => boolean), refine: (validator: V) => V): V & ConditionalAPI<V>;
7
- declare function sometimes<V extends Validator<any>>(this: ConditionalValidator<V>): V & ConditionalAPI<V>;
8
2
  /**
9
3
  * Mixin: add `.when()` / `.sometimes()` to a validator instance.
10
4
  *
@@ -66,3 +60,4 @@ export declare interface ConditionalAPI<V extends Validator<any>> {
66
60
  declare type ConditionalValidator<V extends Validator<any>> = V
67
61
  & ConditionalAPI<V>
68
62
  & ValidatorWithConditionals<V>;
63
+ export {};
@@ -54,6 +54,8 @@ declare interface ValidationResult { valid: boolean, errors?: ValidationError[]
54
54
  * `@stacksjs/storage/image` opt-in (deliverable 5 of #1856).
55
55
  */
56
56
  export declare class FileValidator {
57
+ private _required;
58
+ private _rules;
57
59
  required(): this;
58
60
  image(): this;
59
61
  mimeTypes(allowed: string[]): this;
@@ -63,3 +65,4 @@ export declare class FileValidator {
63
65
  custom(rule: (file: FileLike) => string | null): this;
64
66
  validate(value: unknown): ValidationResult;
65
67
  }
68
+ export {};
@@ -39,3 +39,4 @@ declare interface ReportedError { message: string }
39
39
  */
40
40
  /** A field's custom messages: one for any failure, or one per rule name. */
41
41
  export type FieldMessages = string | Readonly<Record<string, string>>;
42
+ export {};
@@ -5,3 +5,4 @@ export declare function withValidationContext<T>(run: () => T): T;
5
5
  export declare function reportError(errors: MessageObject[]): void;
6
6
  export declare function getErrors(): MessageObject[];
7
7
  declare interface MessageObject { message: string, value: string, field: string }
8
+ export {};
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/validation",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.75.519",
5
+ "version": "0.75.522",
6
6
  "description": "The Stacks Validation ways.",
7
7
  "author": "Chris Breuer",
8
8
  "contributors": [
@@ -64,18 +64,18 @@
64
64
  "prepublishOnly": "bun run build"
65
65
  },
66
66
  "dependencies": {
67
- "@stacksjs/error-handling": "0.75.519",
68
- "@stacksjs/path": "0.75.519",
69
- "@stacksjs/strings": "0.75.519",
67
+ "@stacksjs/error-handling": "0.75.522",
68
+ "@stacksjs/path": "0.75.522",
69
+ "@stacksjs/strings": "0.75.522",
70
70
  "@stacksjs/ts-validation": "^0.5.7",
71
- "@stacksjs/types": "0.75.519",
72
- "@stacksjs/utils": "0.75.519"
71
+ "@stacksjs/types": "0.75.522",
72
+ "@stacksjs/utils": "0.75.522"
73
73
  },
74
74
  "devDependencies": {
75
75
  "better-dx": "^0.2.24"
76
76
  },
77
77
  "peerDependencies": {
78
- "@stacksjs/database": "0.75.519"
78
+ "@stacksjs/database": "0.75.522"
79
79
  },
80
80
  "peerDependenciesMeta": {
81
81
  "@stacksjs/database": {