@awsless/validate 0.0.3 → 0.0.5

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.cjs CHANGED
@@ -15,215 +15,141 @@ var __copyProps = (to, from, except, desc) => {
15
15
  }
16
16
  return to;
17
17
  };
18
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
20
 
20
21
  // src/index.ts
21
22
  var src_exports = {};
22
23
  __export(src_exports, {
23
- Struct: () => import_superstruct7.Struct,
24
- StructError: () => import_superstruct7.StructError,
25
- any: () => import_superstruct7.any,
26
- array: () => import_superstruct7.array,
27
- assert: () => import_superstruct7.assert,
28
- assign: () => import_superstruct7.assign,
29
24
  bigfloat: () => bigfloat,
30
- bigint: () => import_superstruct7.bigint,
31
- boolean: () => import_superstruct7.boolean,
32
- coerce: () => import_superstruct7.coerce,
33
- create: () => import_superstruct7.create,
34
25
  date: () => date,
35
- defaulted: () => import_superstruct7.defaulted,
36
- define: () => import_superstruct7.define,
37
- deprecated: () => import_superstruct7.deprecated,
38
- dynamic: () => import_superstruct7.dynamic,
39
- empty: () => import_superstruct7.empty,
40
- enums: () => import_superstruct7.enums,
41
- func: () => import_superstruct7.func,
42
- instance: () => import_superstruct7.instance,
43
- integer: () => import_superstruct7.integer,
44
- intersection: () => import_superstruct7.intersection,
45
- is: () => import_superstruct7.is,
46
26
  json: () => json,
47
- lazy: () => import_superstruct7.lazy,
48
- literal: () => import_superstruct7.literal,
49
- lowercase: () => lowercase,
50
- map: () => import_superstruct7.map,
51
- mask: () => import_superstruct7.mask,
52
- max: () => import_superstruct7.max,
53
- min: () => import_superstruct7.min,
54
- never: () => import_superstruct7.never,
55
- nonempty: () => import_superstruct7.nonempty,
56
- nullable: () => import_superstruct7.nullable,
57
- number: () => import_superstruct7.number,
58
- object: () => import_superstruct7.object,
59
- omit: () => import_superstruct7.omit,
60
- optional: () => import_superstruct7.optional,
61
- partial: () => import_superstruct7.partial,
62
- pattern: () => import_superstruct7.pattern,
63
- pick: () => import_superstruct7.pick,
64
27
  positive: () => positive,
65
28
  precision: () => precision,
66
- record: () => import_superstruct7.record,
67
- refine: () => import_superstruct7.refine,
68
- regexp: () => import_superstruct7.regexp,
69
- set: () => import_superstruct7.set,
70
- size: () => import_superstruct7.size,
71
- string: () => import_superstruct7.string,
72
- struct: () => import_superstruct7.struct,
73
- trimmed: () => import_superstruct7.trimmed,
74
- tuple: () => import_superstruct7.tuple,
75
- type: () => import_superstruct7.type,
76
- union: () => import_superstruct7.union,
77
29
  unique: () => unique,
78
- unknown: () => import_superstruct7.unknown,
79
- uppercase: () => uppercase,
80
30
  uuid: () => uuid
81
31
  });
82
32
  module.exports = __toCommonJS(src_exports);
33
+ __reExport(src_exports, require("valibot"), module.exports);
83
34
 
84
- // src/types/bigfloat.ts
85
- var import_superstruct = require("superstruct");
86
- var import_big_float = require("@awsless/big-float");
87
- var bigfloat = () => {
88
- const base = (0, import_superstruct.define)("bigfloat", (value) => {
89
- return value instanceof import_big_float.BigFloat || "Invalid number";
90
- });
91
- return (0, import_superstruct.coerce)(base, (0, import_superstruct.union)([(0, import_superstruct.string)(), (0, import_superstruct.number)()]), (value) => {
92
- if (typeof value === "string" && value !== "" || typeof value === "number") {
93
- if (!isNaN(Number(value))) {
94
- return new import_big_float.BigFloat(value);
35
+ // src/schema/json.ts
36
+ var import_valibot = require("valibot");
37
+ var json = (schema) => {
38
+ return (0, import_valibot.transform)(
39
+ (0, import_valibot.string)(),
40
+ (value) => {
41
+ try {
42
+ return JSON.parse(value);
43
+ } catch (error) {
44
+ return null;
95
45
  }
96
- }
97
- return null;
98
- });
99
- };
100
- var positive = (struct2) => {
101
- const expected = `Expected a positive ${struct2.type}`;
102
- const ZERO = new import_big_float.BigFloat(0);
103
- return (0, import_superstruct.refine)(struct2, "positive", (value) => {
104
- return (0, import_big_float.gt)(value, ZERO) || `${expected} but received '${value}'`;
105
- });
106
- };
107
- var precision = (struct2, decimals) => {
108
- const expected = `Expected a ${struct2.type}`;
109
- return (0, import_superstruct.refine)(struct2, "precision", (value) => {
110
- const big = new import_big_float.BigFloat(value);
111
- return -big.exponent <= decimals || `${expected} with ${decimals} decimals`;
112
- });
46
+ },
47
+ schema
48
+ );
113
49
  };
114
50
 
115
- // src/types/date.ts
116
- var import_superstruct2 = require("superstruct");
117
- var date = () => {
118
- return (0, import_superstruct2.coerce)((0, import_superstruct2.date)(), (0, import_superstruct2.string)(), (value) => {
119
- return new Date(value);
120
- });
121
- };
51
+ // src/schema/bigfloat.ts
52
+ var import_big_float = require("@awsless/big-float");
53
+ var import_valibot2 = require("valibot");
54
+ var make = (value) => new import_big_float.BigFloat(value);
55
+ function bigfloat(arg1, arg2) {
56
+ const [msg, pipe] = (0, import_valibot2.getDefaultArgs)(arg1, arg2);
57
+ const error = msg ?? "Invalid bigfloat";
58
+ return (0, import_valibot2.union)(
59
+ [
60
+ (0, import_valibot2.instance)(import_big_float.BigFloat, pipe),
61
+ (0, import_valibot2.transform)(
62
+ (0, import_valibot2.string)([
63
+ (input) => {
64
+ if (input === "" || isNaN(Number(input))) {
65
+ return (0, import_valibot2.getPipeIssues)("bigfloat", error, input);
66
+ }
67
+ return (0, import_valibot2.getOutput)(input);
68
+ }
69
+ ]),
70
+ make,
71
+ pipe
72
+ ),
73
+ (0, import_valibot2.transform)((0, import_valibot2.number)(), make, pipe),
74
+ (0, import_valibot2.transform)(
75
+ (0, import_valibot2.object)({
76
+ exponent: (0, import_valibot2.number)(),
77
+ coefficient: (0, import_valibot2.bigint)()
78
+ }),
79
+ make,
80
+ pipe
81
+ )
82
+ ],
83
+ error
84
+ );
85
+ }
86
+
87
+ // src/schema/date.ts
88
+ var import_valibot3 = require("valibot");
89
+ function date(arg1, arg2) {
90
+ const [error, pipe] = (0, import_valibot3.getDefaultArgs)(arg1, arg2);
91
+ return (0, import_valibot3.union)(
92
+ [
93
+ (0, import_valibot3.date)(pipe),
94
+ (0, import_valibot3.transform)(
95
+ (0, import_valibot3.string)(),
96
+ (input) => {
97
+ return new Date(input);
98
+ },
99
+ (0, import_valibot3.date)(pipe)
100
+ )
101
+ ],
102
+ error ?? "Invalid date"
103
+ );
104
+ }
122
105
 
123
- // src/types/uuid.ts
124
- var import_superstruct3 = require("superstruct");
106
+ // src/schema/uuid.ts
107
+ var import_valibot4 = require("valibot");
125
108
  var uuid = () => {
126
- return (0, import_superstruct3.define)("uuid", (value) => {
127
- return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(String(value));
128
- });
109
+ return (0, import_valibot4.transform)((0, import_valibot4.string)([(0, import_valibot4.uuid)()]), (v) => v);
129
110
  };
130
111
 
131
- // src/types/json.ts
132
- var import_superstruct4 = require("superstruct");
133
- var json = (struct2) => {
134
- return (0, import_superstruct4.coerce)(struct2, (0, import_superstruct4.string)(), (value) => {
135
- try {
136
- return JSON.parse(value);
137
- } catch (error) {
138
- return value;
139
- }
140
- });
141
- };
112
+ // src/validation/positive.ts
113
+ var import_big_float2 = require("@awsless/big-float");
114
+ var import_valibot5 = require("valibot");
115
+ function positive(error) {
116
+ return (input) => {
117
+ return (0, import_big_float2.gt)(input, import_big_float2.ZERO) ? (0, import_valibot5.getOutput)(input) : (0, import_valibot5.getPipeIssues)("positive", error ?? "Invalid positive number", input);
118
+ };
119
+ }
142
120
 
143
- // src/types/string.ts
144
- var import_superstruct5 = require("superstruct");
145
- var lowercase = (struct2) => {
146
- return (0, import_superstruct5.coerce)(struct2, (0, import_superstruct5.string)(), (value) => value.toLowerCase());
147
- };
148
- var uppercase = (struct2) => {
149
- return (0, import_superstruct5.coerce)(struct2, (0, import_superstruct5.string)(), (value) => value.toUpperCase());
150
- };
121
+ // src/validation/precision.ts
122
+ var import_big_float3 = require("@awsless/big-float");
123
+ var import_valibot6 = require("valibot");
124
+ function precision(decimals, error) {
125
+ return (input) => {
126
+ const big = new import_big_float3.BigFloat(input.toString());
127
+ return -big.exponent <= decimals ? (0, import_valibot6.getOutput)(input) : (0, import_valibot6.getPipeIssues)("precision", error ?? `Invalid ${decimals} precision number`, input);
128
+ };
129
+ }
151
130
 
152
- // src/types/array.ts
153
- var import_superstruct6 = require("superstruct");
154
- function unique(struct2, compare = (a, b) => a === b) {
155
- return (0, import_superstruct6.refine)(struct2, "unique", (value) => {
156
- for (const x in value) {
157
- for (const y in value) {
158
- if (x !== y && compare(value[x], value[y])) {
159
- return `Expected a ${struct2.type} with unique values, but received "${value}"`;
131
+ // src/validation/unique.ts
132
+ var import_valibot7 = require("valibot");
133
+ function unique(compare = (a, b) => a === b, error) {
134
+ return (input) => {
135
+ for (const x in input) {
136
+ for (const y in input) {
137
+ if (x !== y && compare(input[x], input[y])) {
138
+ return (0, import_valibot7.getPipeIssues)("unique", error ?? "None unique array", input);
160
139
  }
161
140
  }
162
141
  }
163
- return true;
164
- });
142
+ return (0, import_valibot7.getOutput)(input);
143
+ };
165
144
  }
166
-
167
- // src/index.ts
168
- var import_superstruct7 = require("superstruct");
169
145
  // Annotate the CommonJS export names for ESM import in node:
170
146
  0 && (module.exports = {
171
- Struct,
172
- StructError,
173
- any,
174
- array,
175
- assert,
176
- assign,
177
147
  bigfloat,
178
- bigint,
179
- boolean,
180
- coerce,
181
- create,
182
148
  date,
183
- defaulted,
184
- define,
185
- deprecated,
186
- dynamic,
187
- empty,
188
- enums,
189
- func,
190
- instance,
191
- integer,
192
- intersection,
193
- is,
194
149
  json,
195
- lazy,
196
- literal,
197
- lowercase,
198
- map,
199
- mask,
200
- max,
201
- min,
202
- never,
203
- nonempty,
204
- nullable,
205
- number,
206
- object,
207
- omit,
208
- optional,
209
- partial,
210
- pattern,
211
- pick,
212
150
  positive,
213
151
  precision,
214
- record,
215
- refine,
216
- regexp,
217
- set,
218
- size,
219
- string,
220
- struct,
221
- trimmed,
222
- tuple,
223
- type,
224
- union,
225
152
  unique,
226
- unknown,
227
- uppercase,
228
- uuid
153
+ uuid,
154
+ ...require("valibot")
229
155
  });
@@ -0,0 +1,29 @@
1
+ import { BaseSchema, SchemaWithTransform, StringSchema, Output, Pipe, ErrorMessage, PipeResult } from 'valibot';
2
+ export * from 'valibot';
3
+ import { BigFloat } from '@awsless/big-float';
4
+ import { UUID } from 'crypto';
5
+
6
+ type JsonSchema<T extends BaseSchema> = SchemaWithTransform<StringSchema, Output<T>>;
7
+ declare const json: <T extends BaseSchema<any, any>>(schema: T) => JsonSchema<T>;
8
+
9
+ type BigFloatSchema = BaseSchema<string | number | BigFloat | {
10
+ exponent: number;
11
+ coefficient: bigint;
12
+ }, BigFloat>;
13
+ declare function bigfloat(pipe?: Pipe<BigFloat>): BigFloatSchema;
14
+ declare function bigfloat(error?: ErrorMessage, pipe?: Pipe<BigFloat>): BigFloatSchema;
15
+
16
+ type DateSchema = BaseSchema<string | Date, Date>;
17
+ declare function date(pipe?: Pipe<Date>): DateSchema;
18
+ declare function date(error?: ErrorMessage, pipe?: Pipe<Date>): DateSchema;
19
+
20
+ type UuidSchema = SchemaWithTransform<StringSchema | BaseSchema<UUID>, UUID>;
21
+ declare const uuid: () => UuidSchema;
22
+
23
+ declare function positive<T extends BigFloat | number>(error?: ErrorMessage): (input: T) => PipeResult<T>;
24
+
25
+ declare function precision<T extends BigFloat | number>(decimals: number, error?: ErrorMessage): (input: T) => PipeResult<T>;
26
+
27
+ declare function unique<T extends any[]>(compare?: (a: T[number], b: T[number]) => boolean, error?: ErrorMessage): (input: T) => PipeResult<T>;
28
+
29
+ export { bigfloat, date, json, positive, precision, unique, uuid };
package/dist/index.d.ts CHANGED
@@ -1,21 +1,29 @@
1
- import { Struct } from 'superstruct';
2
- export { Coercer, Context, Describe, Failure, Infer, Refiner, Result, Struct, StructError, Validator, any, array, assert, assign, bigint, boolean, coerce, create, defaulted, define, deprecated, dynamic, empty, enums, func, instance, integer, intersection, is, lazy, literal, map, mask, max, min, never, nonempty, nullable, number, object, omit, optional, partial, pattern, pick, record, refine, regexp, set, size, string, struct, trimmed, tuple, type, union, unknown } from 'superstruct';
1
+ import { BaseSchema, SchemaWithTransform, StringSchema, Output, Pipe, ErrorMessage, PipeResult } from 'valibot';
2
+ export * from 'valibot';
3
3
  import { BigFloat } from '@awsless/big-float';
4
4
  import { UUID } from 'crypto';
5
5
 
6
- declare const bigfloat: () => Struct<BigFloat, null>;
7
- declare const positive: <T extends number | BigFloat, S extends unknown>(struct: Struct<T, S>) => Struct<T, S>;
8
- declare const precision: <T extends number | BigFloat, S extends unknown>(struct: Struct<T, S>, decimals: number) => Struct<T, S>;
6
+ type JsonSchema<T extends BaseSchema> = SchemaWithTransform<StringSchema, Output<T>>;
7
+ declare const json: <T extends BaseSchema<any, any>>(schema: T) => JsonSchema<T>;
9
8
 
10
- declare const date: () => Struct<Date, null>;
9
+ type BigFloatSchema = BaseSchema<string | number | BigFloat | {
10
+ exponent: number;
11
+ coefficient: bigint;
12
+ }, BigFloat>;
13
+ declare function bigfloat(pipe?: Pipe<BigFloat>): BigFloatSchema;
14
+ declare function bigfloat(error?: ErrorMessage, pipe?: Pipe<BigFloat>): BigFloatSchema;
11
15
 
12
- declare const uuid: () => Struct<UUID, null>;
16
+ type DateSchema = BaseSchema<string | Date, Date>;
17
+ declare function date(pipe?: Pipe<Date>): DateSchema;
18
+ declare function date(error?: ErrorMessage, pipe?: Pipe<Date>): DateSchema;
13
19
 
14
- declare const json: <T, S>(struct: Struct<T, S>) => Struct<T, S>;
20
+ type UuidSchema = SchemaWithTransform<StringSchema | BaseSchema<UUID>, UUID>;
21
+ declare const uuid: () => UuidSchema;
15
22
 
16
- declare const lowercase: <T, S>(struct: Struct<T, S>) => Struct<T, S>;
17
- declare const uppercase: <T, S>(struct: Struct<T, S>) => Struct<T, S>;
23
+ declare function positive<T extends BigFloat | number>(error?: ErrorMessage): (input: T) => PipeResult<T>;
18
24
 
19
- declare function unique<T extends any[], S extends any>(struct: Struct<T, S>, compare?: (a: T[number], b: T[number]) => boolean): Struct<T, S>;
25
+ declare function precision<T extends BigFloat | number>(decimals: number, error?: ErrorMessage): (input: T) => PipeResult<T>;
20
26
 
21
- export { bigfloat, date, json, lowercase, positive, precision, unique, uppercase, uuid };
27
+ declare function unique<T extends any[]>(compare?: (a: T[number], b: T[number]) => boolean, error?: ErrorMessage): (input: T) => PipeResult<T>;
28
+
29
+ export { bigfloat, date, json, positive, precision, unique, uuid };
package/dist/index.js CHANGED
@@ -1,195 +1,133 @@
1
- // src/types/bigfloat.ts
2
- import { coerce, define, number, string, union, refine } from "superstruct";
3
- import { BigFloat, gt } from "@awsless/big-float";
4
- var bigfloat = () => {
5
- const base = define("bigfloat", (value) => {
6
- return value instanceof BigFloat || "Invalid number";
7
- });
8
- return coerce(base, union([string(), number()]), (value) => {
9
- if (typeof value === "string" && value !== "" || typeof value === "number") {
10
- if (!isNaN(Number(value))) {
11
- return new BigFloat(value);
1
+ // src/index.ts
2
+ export * from "valibot";
3
+
4
+ // src/schema/json.ts
5
+ import { string, transform } from "valibot";
6
+ var json = (schema) => {
7
+ return transform(
8
+ string(),
9
+ (value) => {
10
+ try {
11
+ return JSON.parse(value);
12
+ } catch (error) {
13
+ return null;
12
14
  }
13
- }
14
- return null;
15
- });
16
- };
17
- var positive = (struct2) => {
18
- const expected = `Expected a positive ${struct2.type}`;
19
- const ZERO = new BigFloat(0);
20
- return refine(struct2, "positive", (value) => {
21
- return gt(value, ZERO) || `${expected} but received '${value}'`;
22
- });
23
- };
24
- var precision = (struct2, decimals) => {
25
- const expected = `Expected a ${struct2.type}`;
26
- return refine(struct2, "precision", (value) => {
27
- const big = new BigFloat(value);
28
- return -big.exponent <= decimals || `${expected} with ${decimals} decimals`;
29
- });
15
+ },
16
+ schema
17
+ );
30
18
  };
31
19
 
32
- // src/types/date.ts
33
- import { coerce as coerce2, date as sdate, string as string2 } from "superstruct";
34
- var date = () => {
35
- return coerce2(sdate(), string2(), (value) => {
36
- return new Date(value);
37
- });
38
- };
20
+ // src/schema/bigfloat.ts
21
+ import { BigFloat } from "@awsless/big-float";
22
+ import {
23
+ bigint,
24
+ getDefaultArgs,
25
+ instance,
26
+ number,
27
+ object,
28
+ string as string2,
29
+ transform as transform2,
30
+ union,
31
+ getPipeIssues,
32
+ getOutput
33
+ } from "valibot";
34
+ var make = (value) => new BigFloat(value);
35
+ function bigfloat(arg1, arg2) {
36
+ const [msg, pipe] = getDefaultArgs(arg1, arg2);
37
+ const error = msg ?? "Invalid bigfloat";
38
+ return union(
39
+ [
40
+ instance(BigFloat, pipe),
41
+ transform2(
42
+ string2([
43
+ (input) => {
44
+ if (input === "" || isNaN(Number(input))) {
45
+ return getPipeIssues("bigfloat", error, input);
46
+ }
47
+ return getOutput(input);
48
+ }
49
+ ]),
50
+ make,
51
+ pipe
52
+ ),
53
+ transform2(number(), make, pipe),
54
+ transform2(
55
+ object({
56
+ exponent: number(),
57
+ coefficient: bigint()
58
+ }),
59
+ make,
60
+ pipe
61
+ )
62
+ ],
63
+ error
64
+ );
65
+ }
39
66
 
40
- // src/types/uuid.ts
41
- import { define as define2 } from "superstruct";
67
+ // src/schema/date.ts
68
+ import { getDefaultArgs as getDefaultArgs2, date as base, string as string3, union as union2, transform as transform3 } from "valibot";
69
+ function date(arg1, arg2) {
70
+ const [error, pipe] = getDefaultArgs2(arg1, arg2);
71
+ return union2(
72
+ [
73
+ base(pipe),
74
+ transform3(
75
+ string3(),
76
+ (input) => {
77
+ return new Date(input);
78
+ },
79
+ base(pipe)
80
+ )
81
+ ],
82
+ error ?? "Invalid date"
83
+ );
84
+ }
85
+
86
+ // src/schema/uuid.ts
87
+ import { string as string4, uuid as base2, transform as transform4 } from "valibot";
42
88
  var uuid = () => {
43
- return define2("uuid", (value) => {
44
- return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(String(value));
45
- });
89
+ return transform4(string4([base2()]), (v) => v);
46
90
  };
47
91
 
48
- // src/types/json.ts
49
- import { coerce as coerce3, string as string3 } from "superstruct";
50
- var json = (struct2) => {
51
- return coerce3(struct2, string3(), (value) => {
52
- try {
53
- return JSON.parse(value);
54
- } catch (error) {
55
- return value;
56
- }
57
- });
58
- };
92
+ // src/validation/positive.ts
93
+ import { ZERO, gt } from "@awsless/big-float";
94
+ import { getOutput as getOutput2, getPipeIssues as getPipeIssues2 } from "valibot";
95
+ function positive(error) {
96
+ return (input) => {
97
+ return gt(input, ZERO) ? getOutput2(input) : getPipeIssues2("positive", error ?? "Invalid positive number", input);
98
+ };
99
+ }
59
100
 
60
- // src/types/string.ts
61
- import { coerce as coerce4, string as string4 } from "superstruct";
62
- var lowercase = (struct2) => {
63
- return coerce4(struct2, string4(), (value) => value.toLowerCase());
64
- };
65
- var uppercase = (struct2) => {
66
- return coerce4(struct2, string4(), (value) => value.toUpperCase());
67
- };
101
+ // src/validation/precision.ts
102
+ import { BigFloat as BigFloat3 } from "@awsless/big-float";
103
+ import { getOutput as getOutput3, getPipeIssues as getPipeIssues3 } from "valibot";
104
+ function precision(decimals, error) {
105
+ return (input) => {
106
+ const big = new BigFloat3(input.toString());
107
+ return -big.exponent <= decimals ? getOutput3(input) : getPipeIssues3("precision", error ?? `Invalid ${decimals} precision number`, input);
108
+ };
109
+ }
68
110
 
69
- // src/types/array.ts
70
- import { refine as refine2 } from "superstruct";
71
- function unique(struct2, compare = (a, b) => a === b) {
72
- return refine2(struct2, "unique", (value) => {
73
- for (const x in value) {
74
- for (const y in value) {
75
- if (x !== y && compare(value[x], value[y])) {
76
- return `Expected a ${struct2.type} with unique values, but received "${value}"`;
111
+ // src/validation/unique.ts
112
+ import { getOutput as getOutput4, getPipeIssues as getPipeIssues4 } from "valibot";
113
+ function unique(compare = (a, b) => a === b, error) {
114
+ return (input) => {
115
+ for (const x in input) {
116
+ for (const y in input) {
117
+ if (x !== y && compare(input[x], input[y])) {
118
+ return getPipeIssues4("unique", error ?? "None unique array", input);
77
119
  }
78
120
  }
79
121
  }
80
- return true;
81
- });
122
+ return getOutput4(input);
123
+ };
82
124
  }
83
-
84
- // src/index.ts
85
- import {
86
- coerce as coerce5,
87
- defaulted,
88
- trimmed,
89
- empty,
90
- max,
91
- min,
92
- nonempty,
93
- pattern,
94
- size,
95
- refine as refine3,
96
- any,
97
- array,
98
- bigint,
99
- boolean,
100
- enums,
101
- func,
102
- instance,
103
- integer,
104
- intersection,
105
- literal,
106
- map,
107
- never,
108
- nullable,
109
- number as number2,
110
- object,
111
- optional,
112
- record,
113
- regexp,
114
- set,
115
- string as string5,
116
- tuple,
117
- type,
118
- union as union2,
119
- unknown,
120
- assign,
121
- define as define3,
122
- deprecated,
123
- dynamic,
124
- lazy,
125
- omit,
126
- partial,
127
- pick,
128
- struct,
129
- assert,
130
- create,
131
- mask,
132
- is,
133
- Struct as Struct7,
134
- StructError
135
- } from "superstruct";
136
125
  export {
137
- Struct7 as Struct,
138
- StructError,
139
- any,
140
- array,
141
- assert,
142
- assign,
143
126
  bigfloat,
144
- bigint,
145
- boolean,
146
- coerce5 as coerce,
147
- create,
148
127
  date,
149
- defaulted,
150
- define3 as define,
151
- deprecated,
152
- dynamic,
153
- empty,
154
- enums,
155
- func,
156
- instance,
157
- integer,
158
- intersection,
159
- is,
160
128
  json,
161
- lazy,
162
- literal,
163
- lowercase,
164
- map,
165
- mask,
166
- max,
167
- min,
168
- never,
169
- nonempty,
170
- nullable,
171
- number2 as number,
172
- object,
173
- omit,
174
- optional,
175
- partial,
176
- pattern,
177
- pick,
178
129
  positive,
179
130
  precision,
180
- record,
181
- refine3 as refine,
182
- regexp,
183
- set,
184
- size,
185
- string5 as string,
186
- struct,
187
- trimmed,
188
- tuple,
189
- type,
190
- union2 as union,
191
131
  unique,
192
- unknown,
193
- uppercase,
194
132
  uuid
195
133
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/validate",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
@@ -24,13 +24,13 @@
24
24
  }
25
25
  },
26
26
  "peerDependencies": {
27
- "@awsless/big-float": "^0.0.2"
27
+ "@awsless/big-float": "^0.0.4"
28
28
  },
29
29
  "devDependencies": {
30
- "@awsless/big-float": "^0.0.2"
30
+ "@awsless/big-float": "^0.0.4"
31
31
  },
32
32
  "dependencies": {
33
- "superstruct": "^1.0.3"
33
+ "valibot": "^0.20.1"
34
34
  },
35
35
  "scripts": {
36
36
  "test": "pnpm code test",