@stacksjs/validation 0.68.1 → 0.69.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/index.js +236 -79
- package/dist/schema.d.ts +17 -10
- package/package.json +5 -7
package/dist/schema.d.ts
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import rule from 'validator';
|
|
2
|
+
import schema, { SimpleMessagesProvider, errors as VineError } from '@vinejs/vine';
|
|
3
|
+
|
|
4
|
+
export type { Infer } from '@vinejs/vine/types'
|
|
4
5
|
declare type SchemaString = string
|
|
5
6
|
type SchemaNumber = number
|
|
6
7
|
type SchemaBoolean = boolean
|
|
7
8
|
type SchemaEnum = string[]
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
|
|
10
|
+
export type SchemaType = SchemaString | SchemaNumber | SchemaBoolean | SchemaEnum
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export const validate = {
|
|
14
|
+
string: (defaultValue = ''): SchemaString => defaultValue,
|
|
15
|
+
number: (defaultValue = 1): SchemaNumber => defaultValue,
|
|
16
|
+
boolean: (defaultValue = true): SchemaBoolean => defaultValue,
|
|
17
|
+
enum: (values: string[]): SchemaEnum => values,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { rule, schema, SimpleMessagesProvider, VineError }
|
|
21
|
+
export { VineBoolean, VineDate, VineEnum, VineNumber, VineString } from '@vinejs/vine'
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/validation",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.69.1",
|
|
5
5
|
"description": "The Stacks Validation ways.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"contributors": ["Chris Breuer <chris@stacksjs.org>"],
|
|
@@ -36,12 +36,10 @@
|
|
|
36
36
|
"typecheck": "bun tsc --noEmit",
|
|
37
37
|
"prepublishOnly": "bun run build"
|
|
38
38
|
},
|
|
39
|
-
"dependencies": {
|
|
40
|
-
"@stacksjs/strings": "0.67.0",
|
|
41
|
-
"@stacksjs/types": "0.67.0",
|
|
42
|
-
"@vinejs/vine": "^2.1.0"
|
|
43
|
-
},
|
|
44
39
|
"devDependencies": {
|
|
45
|
-
"@stacksjs/development": "0.
|
|
40
|
+
"@stacksjs/development": "0.68.2",
|
|
41
|
+
"@stacksjs/strings": "0.68.2",
|
|
42
|
+
"@stacksjs/types": "0.68.2",
|
|
43
|
+
"@vinejs/vine": "^3.0.0"
|
|
46
44
|
}
|
|
47
45
|
}
|