lkd-web-kit 0.4.8 → 0.4.10
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/components/MyDateInput/index.cjs +19 -0
- package/dist/components/MyDateInput/index.js +15 -0
- package/dist/form/base/FormDateInput.cjs +17 -0
- package/dist/form/base/FormDateInput.js +13 -0
- package/dist/hooks/useZodConfig.cjs +2 -2
- package/dist/hooks/useZodConfig.js +2 -2
- package/dist/index.cjs +11 -7
- package/dist/index.d.ts +14 -4
- package/dist/index.js +2 -0
- package/package.json +8 -8
- package/dist/node_modules/zod/v4/classic/coerce.cjs +0 -28
- package/dist/node_modules/zod/v4/classic/coerce.js +0 -20
- package/dist/node_modules/zod/v4/classic/compat.cjs +0 -37
- package/dist/node_modules/zod/v4/classic/compat.js +0 -30
- package/dist/node_modules/zod/v4/classic/errors.cjs +0 -49
- package/dist/node_modules/zod/v4/classic/errors.js +0 -44
- package/dist/node_modules/zod/v4/classic/external.cjs +0 -231
- package/dist/node_modules/zod/v4/classic/external.js +0 -28
- package/dist/node_modules/zod/v4/classic/index.cjs +0 -10
- package/dist/node_modules/zod/v4/classic/index.js +0 -5
- package/dist/node_modules/zod/v4/classic/iso.cjs +0 -46
- package/dist/node_modules/zod/v4/classic/iso.js +0 -35
- package/dist/node_modules/zod/v4/classic/parse.cjs +0 -16
- package/dist/node_modules/zod/v4/classic/parse.js +0 -9
- package/dist/node_modules/zod/v4/classic/schemas.cjs +0 -1155
- package/dist/node_modules/zod/v4/classic/schemas.js +0 -1006
- package/dist/node_modules/zod/v4/core/api.cjs +0 -1016
- package/dist/node_modules/zod/v4/core/api.js +0 -903
- package/dist/node_modules/zod/v4/core/checks.cjs +0 -587
- package/dist/node_modules/zod/v4/core/checks.js +0 -562
- package/dist/node_modules/zod/v4/core/core.cjs +0 -72
- package/dist/node_modules/zod/v4/core/core.js +0 -63
- package/dist/node_modules/zod/v4/core/doc.cjs +0 -41
- package/dist/node_modules/zod/v4/core/doc.js +0 -37
- package/dist/node_modules/zod/v4/core/errors.cjs +0 -204
- package/dist/node_modules/zod/v4/core/errors.js +0 -194
- package/dist/node_modules/zod/v4/core/function.cjs +0 -81
- package/dist/node_modules/zod/v4/core/function.js +0 -76
- package/dist/node_modules/zod/v4/core/index.cjs +0 -261
- package/dist/node_modules/zod/v4/core/index.js +0 -20
- package/dist/node_modules/zod/v4/core/json-schema.cjs +0 -2
- package/dist/node_modules/zod/v4/core/json-schema.js +0 -1
- package/dist/node_modules/zod/v4/core/parse.cjs +0 -71
- package/dist/node_modules/zod/v4/core/parse.js +0 -60
- package/dist/node_modules/zod/v4/core/regexes.cjs +0 -139
- package/dist/node_modules/zod/v4/core/regexes.js +0 -95
- package/dist/node_modules/zod/v4/core/registries.cjs +0 -52
- package/dist/node_modules/zod/v4/core/registries.js +0 -44
- package/dist/node_modules/zod/v4/core/schemas.cjs +0 -1793
- package/dist/node_modules/zod/v4/core/schemas.js +0 -1720
- package/dist/node_modules/zod/v4/core/to-json-schema.cjs +0 -823
- package/dist/node_modules/zod/v4/core/to-json-schema.js +0 -818
- package/dist/node_modules/zod/v4/core/util.cjs +0 -543
- package/dist/node_modules/zod/v4/core/util.js +0 -491
- package/dist/node_modules/zod/v4/core/versions.cjs +0 -11
- package/dist/node_modules/zod/v4/core/versions.js +0 -7
- package/dist/node_modules/zod/v4/index.cjs +0 -10
- package/dist/node_modules/zod/v4/index.js +0 -5
- package/dist/node_modules/zod/v4/locales/ar.cjs +0 -121
- package/dist/node_modules/zod/v4/locales/ar.js +0 -119
- package/dist/node_modules/zod/v4/locales/az.cjs +0 -120
- package/dist/node_modules/zod/v4/locales/az.js +0 -118
- package/dist/node_modules/zod/v4/locales/be.cjs +0 -169
- package/dist/node_modules/zod/v4/locales/be.js +0 -167
- package/dist/node_modules/zod/v4/locales/ca.cjs +0 -123
- package/dist/node_modules/zod/v4/locales/ca.js +0 -121
- package/dist/node_modules/zod/v4/locales/cs.cjs +0 -140
- package/dist/node_modules/zod/v4/locales/cs.js +0 -138
- package/dist/node_modules/zod/v4/locales/de.cjs +0 -121
- package/dist/node_modules/zod/v4/locales/de.js +0 -119
- package/dist/node_modules/zod/v4/locales/en.cjs +0 -125
- package/dist/node_modules/zod/v4/locales/en.js +0 -120
- package/dist/node_modules/zod/v4/locales/eo.cjs +0 -124
- package/dist/node_modules/zod/v4/locales/eo.js +0 -119
- package/dist/node_modules/zod/v4/locales/es.cjs +0 -122
- package/dist/node_modules/zod/v4/locales/es.js +0 -120
- package/dist/node_modules/zod/v4/locales/fa.cjs +0 -127
- package/dist/node_modules/zod/v4/locales/fa.js +0 -125
- package/dist/node_modules/zod/v4/locales/fi.cjs +0 -127
- package/dist/node_modules/zod/v4/locales/fi.js +0 -125
- package/dist/node_modules/zod/v4/locales/fr-CA.cjs +0 -122
- package/dist/node_modules/zod/v4/locales/fr-CA.js +0 -120
- package/dist/node_modules/zod/v4/locales/fr.cjs +0 -121
- package/dist/node_modules/zod/v4/locales/fr.js +0 -119
- package/dist/node_modules/zod/v4/locales/he.cjs +0 -122
- package/dist/node_modules/zod/v4/locales/he.js +0 -120
- package/dist/node_modules/zod/v4/locales/hu.cjs +0 -122
- package/dist/node_modules/zod/v4/locales/hu.js +0 -120
- package/dist/node_modules/zod/v4/locales/id.cjs +0 -121
- package/dist/node_modules/zod/v4/locales/id.js +0 -119
- package/dist/node_modules/zod/v4/locales/index.cjs +0 -85
- package/dist/node_modules/zod/v4/locales/index.js +0 -39
- package/dist/node_modules/zod/v4/locales/it.cjs +0 -122
- package/dist/node_modules/zod/v4/locales/it.js +0 -120
- package/dist/node_modules/zod/v4/locales/ja.cjs +0 -120
- package/dist/node_modules/zod/v4/locales/ja.js +0 -118
- package/dist/node_modules/zod/v4/locales/kh.cjs +0 -122
- package/dist/node_modules/zod/v4/locales/kh.js +0 -120
- package/dist/node_modules/zod/v4/locales/ko.cjs +0 -126
- package/dist/node_modules/zod/v4/locales/ko.js +0 -124
- package/dist/node_modules/zod/v4/locales/mk.cjs +0 -123
- package/dist/node_modules/zod/v4/locales/mk.js +0 -121
- package/dist/node_modules/zod/v4/locales/ms.cjs +0 -121
- package/dist/node_modules/zod/v4/locales/ms.js +0 -119
- package/dist/node_modules/zod/v4/locales/nl.cjs +0 -122
- package/dist/node_modules/zod/v4/locales/nl.js +0 -120
- package/dist/node_modules/zod/v4/locales/no.cjs +0 -121
- package/dist/node_modules/zod/v4/locales/no.js +0 -119
- package/dist/node_modules/zod/v4/locales/ota.cjs +0 -122
- package/dist/node_modules/zod/v4/locales/ota.js +0 -120
- package/dist/node_modules/zod/v4/locales/pl.cjs +0 -122
- package/dist/node_modules/zod/v4/locales/pl.js +0 -120
- package/dist/node_modules/zod/v4/locales/ps.cjs +0 -127
- package/dist/node_modules/zod/v4/locales/ps.js +0 -125
- package/dist/node_modules/zod/v4/locales/pt.cjs +0 -121
- package/dist/node_modules/zod/v4/locales/pt.js +0 -119
- package/dist/node_modules/zod/v4/locales/ru.cjs +0 -169
- package/dist/node_modules/zod/v4/locales/ru.js +0 -167
- package/dist/node_modules/zod/v4/locales/sl.cjs +0 -122
- package/dist/node_modules/zod/v4/locales/sl.js +0 -120
- package/dist/node_modules/zod/v4/locales/sv.cjs +0 -123
- package/dist/node_modules/zod/v4/locales/sv.js +0 -121
- package/dist/node_modules/zod/v4/locales/ta.cjs +0 -122
- package/dist/node_modules/zod/v4/locales/ta.js +0 -120
- package/dist/node_modules/zod/v4/locales/th.cjs +0 -122
- package/dist/node_modules/zod/v4/locales/th.js +0 -120
- package/dist/node_modules/zod/v4/locales/tr.cjs +0 -123
- package/dist/node_modules/zod/v4/locales/tr.js +0 -118
- package/dist/node_modules/zod/v4/locales/ua.cjs +0 -122
- package/dist/node_modules/zod/v4/locales/ua.js +0 -120
- package/dist/node_modules/zod/v4/locales/ur.cjs +0 -122
- package/dist/node_modules/zod/v4/locales/ur.js +0 -120
- package/dist/node_modules/zod/v4/locales/vi.cjs +0 -121
- package/dist/node_modules/zod/v4/locales/vi.js +0 -119
- package/dist/node_modules/zod/v4/locales/zh-CN.cjs +0 -121
- package/dist/node_modules/zod/v4/locales/zh-CN.js +0 -119
- package/dist/node_modules/zod/v4/locales/zh-TW.cjs +0 -122
- package/dist/node_modules/zod/v4/locales/zh-TW.js +0 -120
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
|
|
5
|
-
const core = require('./core.cjs');
|
|
6
|
-
const parse = require('./parse.cjs');
|
|
7
|
-
const errors = require('./errors.cjs');
|
|
8
|
-
const schemas = require('./schemas.cjs');
|
|
9
|
-
const checks = require('./checks.cjs');
|
|
10
|
-
const versions = require('./versions.cjs');
|
|
11
|
-
const util = require('./util.cjs');
|
|
12
|
-
const regexes = require('./regexes.cjs');
|
|
13
|
-
const index = require('../locales/index.cjs');
|
|
14
|
-
const registries = require('./registries.cjs');
|
|
15
|
-
const doc = require('./doc.cjs');
|
|
16
|
-
const _function = require('./function.cjs');
|
|
17
|
-
const api = require('./api.cjs');
|
|
18
|
-
const toJsonSchema = require('./to-json-schema.cjs');
|
|
19
|
-
const jsonSchema = require('./json-schema.cjs');
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
exports.$ZodAsyncError = core.$ZodAsyncError;
|
|
24
|
-
exports.$brand = core.$brand;
|
|
25
|
-
exports.$constructor = core.$constructor;
|
|
26
|
-
exports.NEVER = core.NEVER;
|
|
27
|
-
exports.config = core.config;
|
|
28
|
-
exports.globalConfig = core.globalConfig;
|
|
29
|
-
exports._parse = parse._parse;
|
|
30
|
-
exports._parseAsync = parse._parseAsync;
|
|
31
|
-
exports._safeParse = parse._safeParse;
|
|
32
|
-
exports._safeParseAsync = parse._safeParseAsync;
|
|
33
|
-
exports.parse = parse.parse;
|
|
34
|
-
exports.parseAsync = parse.parseAsync;
|
|
35
|
-
exports.safeParse = parse.safeParse;
|
|
36
|
-
exports.safeParseAsync = parse.safeParseAsync;
|
|
37
|
-
exports.$ZodError = errors.$ZodError;
|
|
38
|
-
exports.$ZodRealError = errors.$ZodRealError;
|
|
39
|
-
exports.flattenError = errors.flattenError;
|
|
40
|
-
exports.formatError = errors.formatError;
|
|
41
|
-
exports.prettifyError = errors.prettifyError;
|
|
42
|
-
exports.toDotPath = errors.toDotPath;
|
|
43
|
-
exports.treeifyError = errors.treeifyError;
|
|
44
|
-
exports.$ZodAny = schemas.$ZodAny;
|
|
45
|
-
exports.$ZodArray = schemas.$ZodArray;
|
|
46
|
-
exports.$ZodBase64 = schemas.$ZodBase64;
|
|
47
|
-
exports.$ZodBase64URL = schemas.$ZodBase64URL;
|
|
48
|
-
exports.$ZodBigInt = schemas.$ZodBigInt;
|
|
49
|
-
exports.$ZodBigIntFormat = schemas.$ZodBigIntFormat;
|
|
50
|
-
exports.$ZodBoolean = schemas.$ZodBoolean;
|
|
51
|
-
exports.$ZodCIDRv4 = schemas.$ZodCIDRv4;
|
|
52
|
-
exports.$ZodCIDRv6 = schemas.$ZodCIDRv6;
|
|
53
|
-
exports.$ZodCUID = schemas.$ZodCUID;
|
|
54
|
-
exports.$ZodCUID2 = schemas.$ZodCUID2;
|
|
55
|
-
exports.$ZodCatch = schemas.$ZodCatch;
|
|
56
|
-
exports.$ZodCustom = schemas.$ZodCustom;
|
|
57
|
-
exports.$ZodCustomStringFormat = schemas.$ZodCustomStringFormat;
|
|
58
|
-
exports.$ZodDate = schemas.$ZodDate;
|
|
59
|
-
exports.$ZodDefault = schemas.$ZodDefault;
|
|
60
|
-
exports.$ZodDiscriminatedUnion = schemas.$ZodDiscriminatedUnion;
|
|
61
|
-
exports.$ZodE164 = schemas.$ZodE164;
|
|
62
|
-
exports.$ZodEmail = schemas.$ZodEmail;
|
|
63
|
-
exports.$ZodEmoji = schemas.$ZodEmoji;
|
|
64
|
-
exports.$ZodEnum = schemas.$ZodEnum;
|
|
65
|
-
exports.$ZodFile = schemas.$ZodFile;
|
|
66
|
-
exports.$ZodGUID = schemas.$ZodGUID;
|
|
67
|
-
exports.$ZodIPv4 = schemas.$ZodIPv4;
|
|
68
|
-
exports.$ZodIPv6 = schemas.$ZodIPv6;
|
|
69
|
-
exports.$ZodISODate = schemas.$ZodISODate;
|
|
70
|
-
exports.$ZodISODateTime = schemas.$ZodISODateTime;
|
|
71
|
-
exports.$ZodISODuration = schemas.$ZodISODuration;
|
|
72
|
-
exports.$ZodISOTime = schemas.$ZodISOTime;
|
|
73
|
-
exports.$ZodIntersection = schemas.$ZodIntersection;
|
|
74
|
-
exports.$ZodJWT = schemas.$ZodJWT;
|
|
75
|
-
exports.$ZodKSUID = schemas.$ZodKSUID;
|
|
76
|
-
exports.$ZodLazy = schemas.$ZodLazy;
|
|
77
|
-
exports.$ZodLiteral = schemas.$ZodLiteral;
|
|
78
|
-
exports.$ZodMap = schemas.$ZodMap;
|
|
79
|
-
exports.$ZodNaN = schemas.$ZodNaN;
|
|
80
|
-
exports.$ZodNanoID = schemas.$ZodNanoID;
|
|
81
|
-
exports.$ZodNever = schemas.$ZodNever;
|
|
82
|
-
exports.$ZodNonOptional = schemas.$ZodNonOptional;
|
|
83
|
-
exports.$ZodNull = schemas.$ZodNull;
|
|
84
|
-
exports.$ZodNullable = schemas.$ZodNullable;
|
|
85
|
-
exports.$ZodNumber = schemas.$ZodNumber;
|
|
86
|
-
exports.$ZodNumberFormat = schemas.$ZodNumberFormat;
|
|
87
|
-
exports.$ZodObject = schemas.$ZodObject;
|
|
88
|
-
exports.$ZodOptional = schemas.$ZodOptional;
|
|
89
|
-
exports.$ZodPipe = schemas.$ZodPipe;
|
|
90
|
-
exports.$ZodPrefault = schemas.$ZodPrefault;
|
|
91
|
-
exports.$ZodPromise = schemas.$ZodPromise;
|
|
92
|
-
exports.$ZodReadonly = schemas.$ZodReadonly;
|
|
93
|
-
exports.$ZodRecord = schemas.$ZodRecord;
|
|
94
|
-
exports.$ZodSet = schemas.$ZodSet;
|
|
95
|
-
exports.$ZodString = schemas.$ZodString;
|
|
96
|
-
exports.$ZodStringFormat = schemas.$ZodStringFormat;
|
|
97
|
-
exports.$ZodSuccess = schemas.$ZodSuccess;
|
|
98
|
-
exports.$ZodSymbol = schemas.$ZodSymbol;
|
|
99
|
-
exports.$ZodTemplateLiteral = schemas.$ZodTemplateLiteral;
|
|
100
|
-
exports.$ZodTransform = schemas.$ZodTransform;
|
|
101
|
-
exports.$ZodTuple = schemas.$ZodTuple;
|
|
102
|
-
exports.$ZodType = schemas.$ZodType;
|
|
103
|
-
exports.$ZodULID = schemas.$ZodULID;
|
|
104
|
-
exports.$ZodURL = schemas.$ZodURL;
|
|
105
|
-
exports.$ZodUUID = schemas.$ZodUUID;
|
|
106
|
-
exports.$ZodUndefined = schemas.$ZodUndefined;
|
|
107
|
-
exports.$ZodUnion = schemas.$ZodUnion;
|
|
108
|
-
exports.$ZodUnknown = schemas.$ZodUnknown;
|
|
109
|
-
exports.$ZodVoid = schemas.$ZodVoid;
|
|
110
|
-
exports.$ZodXID = schemas.$ZodXID;
|
|
111
|
-
exports.isValidBase64 = schemas.isValidBase64;
|
|
112
|
-
exports.isValidBase64URL = schemas.isValidBase64URL;
|
|
113
|
-
exports.isValidJWT = schemas.isValidJWT;
|
|
114
|
-
exports.$ZodCheck = checks.$ZodCheck;
|
|
115
|
-
exports.$ZodCheckBigIntFormat = checks.$ZodCheckBigIntFormat;
|
|
116
|
-
exports.$ZodCheckEndsWith = checks.$ZodCheckEndsWith;
|
|
117
|
-
exports.$ZodCheckGreaterThan = checks.$ZodCheckGreaterThan;
|
|
118
|
-
exports.$ZodCheckIncludes = checks.$ZodCheckIncludes;
|
|
119
|
-
exports.$ZodCheckLengthEquals = checks.$ZodCheckLengthEquals;
|
|
120
|
-
exports.$ZodCheckLessThan = checks.$ZodCheckLessThan;
|
|
121
|
-
exports.$ZodCheckLowerCase = checks.$ZodCheckLowerCase;
|
|
122
|
-
exports.$ZodCheckMaxLength = checks.$ZodCheckMaxLength;
|
|
123
|
-
exports.$ZodCheckMaxSize = checks.$ZodCheckMaxSize;
|
|
124
|
-
exports.$ZodCheckMimeType = checks.$ZodCheckMimeType;
|
|
125
|
-
exports.$ZodCheckMinLength = checks.$ZodCheckMinLength;
|
|
126
|
-
exports.$ZodCheckMinSize = checks.$ZodCheckMinSize;
|
|
127
|
-
exports.$ZodCheckMultipleOf = checks.$ZodCheckMultipleOf;
|
|
128
|
-
exports.$ZodCheckNumberFormat = checks.$ZodCheckNumberFormat;
|
|
129
|
-
exports.$ZodCheckOverwrite = checks.$ZodCheckOverwrite;
|
|
130
|
-
exports.$ZodCheckProperty = checks.$ZodCheckProperty;
|
|
131
|
-
exports.$ZodCheckRegex = checks.$ZodCheckRegex;
|
|
132
|
-
exports.$ZodCheckSizeEquals = checks.$ZodCheckSizeEquals;
|
|
133
|
-
exports.$ZodCheckStartsWith = checks.$ZodCheckStartsWith;
|
|
134
|
-
exports.$ZodCheckStringFormat = checks.$ZodCheckStringFormat;
|
|
135
|
-
exports.$ZodCheckUpperCase = checks.$ZodCheckUpperCase;
|
|
136
|
-
exports.version = versions.version;
|
|
137
|
-
exports.clone = util.clone;
|
|
138
|
-
exports.util = util;
|
|
139
|
-
exports.regexes = regexes;
|
|
140
|
-
exports.locales = index;
|
|
141
|
-
exports.$ZodRegistry = registries.$ZodRegistry;
|
|
142
|
-
exports.$input = registries.$input;
|
|
143
|
-
exports.$output = registries.$output;
|
|
144
|
-
exports.globalRegistry = registries.globalRegistry;
|
|
145
|
-
exports.registry = registries.registry;
|
|
146
|
-
exports.Doc = doc.Doc;
|
|
147
|
-
exports.$ZodFunction = _function.$ZodFunction;
|
|
148
|
-
exports.function = _function.function;
|
|
149
|
-
exports.TimePrecision = api.TimePrecision;
|
|
150
|
-
exports._any = api._any;
|
|
151
|
-
exports._array = api._array;
|
|
152
|
-
exports._base64 = api._base64;
|
|
153
|
-
exports._base64url = api._base64url;
|
|
154
|
-
exports._bigint = api._bigint;
|
|
155
|
-
exports._boolean = api._boolean;
|
|
156
|
-
exports._catch = api._catch;
|
|
157
|
-
exports._cidrv4 = api._cidrv4;
|
|
158
|
-
exports._cidrv6 = api._cidrv6;
|
|
159
|
-
exports._coercedBigint = api._coercedBigint;
|
|
160
|
-
exports._coercedBoolean = api._coercedBoolean;
|
|
161
|
-
exports._coercedDate = api._coercedDate;
|
|
162
|
-
exports._coercedNumber = api._coercedNumber;
|
|
163
|
-
exports._coercedString = api._coercedString;
|
|
164
|
-
exports._cuid = api._cuid;
|
|
165
|
-
exports._cuid2 = api._cuid2;
|
|
166
|
-
exports._custom = api._custom;
|
|
167
|
-
exports._date = api._date;
|
|
168
|
-
exports._default = api._default;
|
|
169
|
-
exports._discriminatedUnion = api._discriminatedUnion;
|
|
170
|
-
exports._e164 = api._e164;
|
|
171
|
-
exports._email = api._email;
|
|
172
|
-
exports._emoji = api._emoji;
|
|
173
|
-
exports._endsWith = api._endsWith;
|
|
174
|
-
exports._enum = api._enum;
|
|
175
|
-
exports._file = api._file;
|
|
176
|
-
exports._float32 = api._float32;
|
|
177
|
-
exports._float64 = api._float64;
|
|
178
|
-
exports._gt = api._gt;
|
|
179
|
-
exports._gte = api._gte;
|
|
180
|
-
exports._guid = api._guid;
|
|
181
|
-
exports._includes = api._includes;
|
|
182
|
-
exports._int = api._int;
|
|
183
|
-
exports._int32 = api._int32;
|
|
184
|
-
exports._int64 = api._int64;
|
|
185
|
-
exports._intersection = api._intersection;
|
|
186
|
-
exports._ipv4 = api._ipv4;
|
|
187
|
-
exports._ipv6 = api._ipv6;
|
|
188
|
-
exports._isoDate = api._isoDate;
|
|
189
|
-
exports._isoDateTime = api._isoDateTime;
|
|
190
|
-
exports._isoDuration = api._isoDuration;
|
|
191
|
-
exports._isoTime = api._isoTime;
|
|
192
|
-
exports._jwt = api._jwt;
|
|
193
|
-
exports._ksuid = api._ksuid;
|
|
194
|
-
exports._lazy = api._lazy;
|
|
195
|
-
exports._length = api._length;
|
|
196
|
-
exports._literal = api._literal;
|
|
197
|
-
exports._lowercase = api._lowercase;
|
|
198
|
-
exports._lt = api._lt;
|
|
199
|
-
exports._lte = api._lte;
|
|
200
|
-
exports._map = api._map;
|
|
201
|
-
exports._max = api._lte;
|
|
202
|
-
exports._maxLength = api._maxLength;
|
|
203
|
-
exports._maxSize = api._maxSize;
|
|
204
|
-
exports._mime = api._mime;
|
|
205
|
-
exports._min = api._gte;
|
|
206
|
-
exports._minLength = api._minLength;
|
|
207
|
-
exports._minSize = api._minSize;
|
|
208
|
-
exports._multipleOf = api._multipleOf;
|
|
209
|
-
exports._nan = api._nan;
|
|
210
|
-
exports._nanoid = api._nanoid;
|
|
211
|
-
exports._nativeEnum = api._nativeEnum;
|
|
212
|
-
exports._negative = api._negative;
|
|
213
|
-
exports._never = api._never;
|
|
214
|
-
exports._nonnegative = api._nonnegative;
|
|
215
|
-
exports._nonoptional = api._nonoptional;
|
|
216
|
-
exports._nonpositive = api._nonpositive;
|
|
217
|
-
exports._normalize = api._normalize;
|
|
218
|
-
exports._null = api._null;
|
|
219
|
-
exports._nullable = api._nullable;
|
|
220
|
-
exports._number = api._number;
|
|
221
|
-
exports._optional = api._optional;
|
|
222
|
-
exports._overwrite = api._overwrite;
|
|
223
|
-
exports._pipe = api._pipe;
|
|
224
|
-
exports._positive = api._positive;
|
|
225
|
-
exports._promise = api._promise;
|
|
226
|
-
exports._property = api._property;
|
|
227
|
-
exports._readonly = api._readonly;
|
|
228
|
-
exports._record = api._record;
|
|
229
|
-
exports._refine = api._refine;
|
|
230
|
-
exports._regex = api._regex;
|
|
231
|
-
exports._set = api._set;
|
|
232
|
-
exports._size = api._size;
|
|
233
|
-
exports._startsWith = api._startsWith;
|
|
234
|
-
exports._string = api._string;
|
|
235
|
-
exports._stringFormat = api._stringFormat;
|
|
236
|
-
exports._stringbool = api._stringbool;
|
|
237
|
-
exports._success = api._success;
|
|
238
|
-
exports._symbol = api._symbol;
|
|
239
|
-
exports._templateLiteral = api._templateLiteral;
|
|
240
|
-
exports._toLowerCase = api._toLowerCase;
|
|
241
|
-
exports._toUpperCase = api._toUpperCase;
|
|
242
|
-
exports._transform = api._transform;
|
|
243
|
-
exports._trim = api._trim;
|
|
244
|
-
exports._tuple = api._tuple;
|
|
245
|
-
exports._uint32 = api._uint32;
|
|
246
|
-
exports._uint64 = api._uint64;
|
|
247
|
-
exports._ulid = api._ulid;
|
|
248
|
-
exports._undefined = api._undefined;
|
|
249
|
-
exports._union = api._union;
|
|
250
|
-
exports._unknown = api._unknown;
|
|
251
|
-
exports._uppercase = api._uppercase;
|
|
252
|
-
exports._url = api._url;
|
|
253
|
-
exports._uuid = api._uuid;
|
|
254
|
-
exports._uuidv4 = api._uuidv4;
|
|
255
|
-
exports._uuidv6 = api._uuidv6;
|
|
256
|
-
exports._uuidv7 = api._uuidv7;
|
|
257
|
-
exports._void = api._void;
|
|
258
|
-
exports._xid = api._xid;
|
|
259
|
-
exports.JSONSchemaGenerator = toJsonSchema.JSONSchemaGenerator;
|
|
260
|
-
exports.toJSONSchema = toJsonSchema.toJSONSchema;
|
|
261
|
-
exports.JSONSchema = jsonSchema;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export { $ZodAsyncError, $brand, $constructor, NEVER, config, globalConfig } from './core.js';
|
|
2
|
-
export { _parse, _parseAsync, _safeParse, _safeParseAsync, parse, parseAsync, safeParse, safeParseAsync } from './parse.js';
|
|
3
|
-
export { $ZodError, $ZodRealError, flattenError, formatError, prettifyError, toDotPath, treeifyError } from './errors.js';
|
|
4
|
-
export { $ZodAny, $ZodArray, $ZodBase64, $ZodBase64URL, $ZodBigInt, $ZodBigIntFormat, $ZodBoolean, $ZodCIDRv4, $ZodCIDRv6, $ZodCUID, $ZodCUID2, $ZodCatch, $ZodCustom, $ZodCustomStringFormat, $ZodDate, $ZodDefault, $ZodDiscriminatedUnion, $ZodE164, $ZodEmail, $ZodEmoji, $ZodEnum, $ZodFile, $ZodGUID, $ZodIPv4, $ZodIPv6, $ZodISODate, $ZodISODateTime, $ZodISODuration, $ZodISOTime, $ZodIntersection, $ZodJWT, $ZodKSUID, $ZodLazy, $ZodLiteral, $ZodMap, $ZodNaN, $ZodNanoID, $ZodNever, $ZodNonOptional, $ZodNull, $ZodNullable, $ZodNumber, $ZodNumberFormat, $ZodObject, $ZodOptional, $ZodPipe, $ZodPrefault, $ZodPromise, $ZodReadonly, $ZodRecord, $ZodSet, $ZodString, $ZodStringFormat, $ZodSuccess, $ZodSymbol, $ZodTemplateLiteral, $ZodTransform, $ZodTuple, $ZodType, $ZodULID, $ZodURL, $ZodUUID, $ZodUndefined, $ZodUnion, $ZodUnknown, $ZodVoid, $ZodXID, isValidBase64, isValidBase64URL, isValidJWT } from './schemas.js';
|
|
5
|
-
export { $ZodCheck, $ZodCheckBigIntFormat, $ZodCheckEndsWith, $ZodCheckGreaterThan, $ZodCheckIncludes, $ZodCheckLengthEquals, $ZodCheckLessThan, $ZodCheckLowerCase, $ZodCheckMaxLength, $ZodCheckMaxSize, $ZodCheckMimeType, $ZodCheckMinLength, $ZodCheckMinSize, $ZodCheckMultipleOf, $ZodCheckNumberFormat, $ZodCheckOverwrite, $ZodCheckProperty, $ZodCheckRegex, $ZodCheckSizeEquals, $ZodCheckStartsWith, $ZodCheckStringFormat, $ZodCheckUpperCase } from './checks.js';
|
|
6
|
-
export { version } from './versions.js';
|
|
7
|
-
import * as util from './util.js';
|
|
8
|
-
export { util };
|
|
9
|
-
export { clone } from './util.js';
|
|
10
|
-
import * as regexes from './regexes.js';
|
|
11
|
-
export { regexes };
|
|
12
|
-
import * as index from '../locales/index.js';
|
|
13
|
-
export { index as locales };
|
|
14
|
-
export { $ZodRegistry, $input, $output, globalRegistry, registry } from './registries.js';
|
|
15
|
-
export { Doc } from './doc.js';
|
|
16
|
-
export { $ZodFunction, function } from './function.js';
|
|
17
|
-
export { TimePrecision, _any, _array, _base64, _base64url, _bigint, _boolean, _catch, _cidrv4, _cidrv6, _coercedBigint, _coercedBoolean, _coercedDate, _coercedNumber, _coercedString, _cuid, _cuid2, _custom, _date, _default, _discriminatedUnion, _e164, _email, _emoji, _endsWith, _enum, _file, _float32, _float64, _gt, _gte, _guid, _includes, _int, _int32, _int64, _intersection, _ipv4, _ipv6, _isoDate, _isoDateTime, _isoDuration, _isoTime, _jwt, _ksuid, _lazy, _length, _literal, _lowercase, _lt, _lte, _map, _lte as _max, _maxLength, _maxSize, _mime, _gte as _min, _minLength, _minSize, _multipleOf, _nan, _nanoid, _nativeEnum, _negative, _never, _nonnegative, _nonoptional, _nonpositive, _normalize, _null, _nullable, _number, _optional, _overwrite, _pipe, _positive, _promise, _property, _readonly, _record, _refine, _regex, _set, _size, _startsWith, _string, _stringFormat, _stringbool, _success, _symbol, _templateLiteral, _toLowerCase, _toUpperCase, _transform, _trim, _tuple, _uint32, _uint64, _ulid, _undefined, _union, _unknown, _uppercase, _url, _uuid, _uuidv4, _uuidv6, _uuidv7, _void, _xid } from './api.js';
|
|
18
|
-
export { JSONSchemaGenerator, toJSONSchema } from './to-json-schema.js';
|
|
19
|
-
import * as jsonSchema from './json-schema.js';
|
|
20
|
-
export { jsonSchema as JSONSchema };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
|
|
5
|
-
const core = require('./core.cjs');
|
|
6
|
-
const errors = require('./errors.cjs');
|
|
7
|
-
const util = require('./util.cjs');
|
|
8
|
-
|
|
9
|
-
const _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
10
|
-
const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
|
|
11
|
-
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
12
|
-
if (result instanceof Promise) {
|
|
13
|
-
throw new core.$ZodAsyncError();
|
|
14
|
-
}
|
|
15
|
-
if (result.issues.length) {
|
|
16
|
-
const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));
|
|
17
|
-
util.captureStackTrace(e, _params?.callee);
|
|
18
|
-
throw e;
|
|
19
|
-
}
|
|
20
|
-
return result.value;
|
|
21
|
-
};
|
|
22
|
-
const parse = /* @__PURE__*/ _parse(errors.$ZodRealError);
|
|
23
|
-
const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
|
|
24
|
-
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
|
25
|
-
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
26
|
-
if (result instanceof Promise)
|
|
27
|
-
result = await result;
|
|
28
|
-
if (result.issues.length) {
|
|
29
|
-
const e = new (params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));
|
|
30
|
-
util.captureStackTrace(e, params?.callee);
|
|
31
|
-
throw e;
|
|
32
|
-
}
|
|
33
|
-
return result.value;
|
|
34
|
-
};
|
|
35
|
-
const parseAsync = /* @__PURE__*/ _parseAsync(errors.$ZodRealError);
|
|
36
|
-
const _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
37
|
-
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
38
|
-
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
39
|
-
if (result instanceof Promise) {
|
|
40
|
-
throw new core.$ZodAsyncError();
|
|
41
|
-
}
|
|
42
|
-
return result.issues.length
|
|
43
|
-
? {
|
|
44
|
-
success: false,
|
|
45
|
-
error: new (_Err ?? errors.$ZodError)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),
|
|
46
|
-
}
|
|
47
|
-
: { success: true, data: result.value };
|
|
48
|
-
};
|
|
49
|
-
const safeParse = /* @__PURE__*/ _safeParse(errors.$ZodRealError);
|
|
50
|
-
const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
51
|
-
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
|
52
|
-
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
53
|
-
if (result instanceof Promise)
|
|
54
|
-
result = await result;
|
|
55
|
-
return result.issues.length
|
|
56
|
-
? {
|
|
57
|
-
success: false,
|
|
58
|
-
error: new _Err(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),
|
|
59
|
-
}
|
|
60
|
-
: { success: true, data: result.value };
|
|
61
|
-
};
|
|
62
|
-
const safeParseAsync = /* @__PURE__*/ _safeParseAsync(errors.$ZodRealError);
|
|
63
|
-
|
|
64
|
-
exports._parse = _parse;
|
|
65
|
-
exports._parseAsync = _parseAsync;
|
|
66
|
-
exports._safeParse = _safeParse;
|
|
67
|
-
exports._safeParseAsync = _safeParseAsync;
|
|
68
|
-
exports.parse = parse;
|
|
69
|
-
exports.parseAsync = parseAsync;
|
|
70
|
-
exports.safeParse = safeParse;
|
|
71
|
-
exports.safeParseAsync = safeParseAsync;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { $ZodAsyncError, config } from './core.js';
|
|
2
|
-
import { $ZodRealError, $ZodError } from './errors.js';
|
|
3
|
-
import { finalizeIssue, captureStackTrace } from './util.js';
|
|
4
|
-
|
|
5
|
-
const _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
6
|
-
const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
|
|
7
|
-
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
8
|
-
if (result instanceof Promise) {
|
|
9
|
-
throw new $ZodAsyncError();
|
|
10
|
-
}
|
|
11
|
-
if (result.issues.length) {
|
|
12
|
-
const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
13
|
-
captureStackTrace(e, _params?.callee);
|
|
14
|
-
throw e;
|
|
15
|
-
}
|
|
16
|
-
return result.value;
|
|
17
|
-
};
|
|
18
|
-
const parse = /* @__PURE__*/ _parse($ZodRealError);
|
|
19
|
-
const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
|
|
20
|
-
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
|
21
|
-
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
22
|
-
if (result instanceof Promise)
|
|
23
|
-
result = await result;
|
|
24
|
-
if (result.issues.length) {
|
|
25
|
-
const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
26
|
-
captureStackTrace(e, params?.callee);
|
|
27
|
-
throw e;
|
|
28
|
-
}
|
|
29
|
-
return result.value;
|
|
30
|
-
};
|
|
31
|
-
const parseAsync = /* @__PURE__*/ _parseAsync($ZodRealError);
|
|
32
|
-
const _safeParse = (_Err) => (schema, value, _ctx) => {
|
|
33
|
-
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
34
|
-
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
35
|
-
if (result instanceof Promise) {
|
|
36
|
-
throw new $ZodAsyncError();
|
|
37
|
-
}
|
|
38
|
-
return result.issues.length
|
|
39
|
-
? {
|
|
40
|
-
success: false,
|
|
41
|
-
error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))),
|
|
42
|
-
}
|
|
43
|
-
: { success: true, data: result.value };
|
|
44
|
-
};
|
|
45
|
-
const safeParse = /* @__PURE__*/ _safeParse($ZodRealError);
|
|
46
|
-
const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
47
|
-
const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
|
|
48
|
-
let result = schema._zod.run({ value, issues: [] }, ctx);
|
|
49
|
-
if (result instanceof Promise)
|
|
50
|
-
result = await result;
|
|
51
|
-
return result.issues.length
|
|
52
|
-
? {
|
|
53
|
-
success: false,
|
|
54
|
-
error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))),
|
|
55
|
-
}
|
|
56
|
-
: { success: true, data: result.value };
|
|
57
|
-
};
|
|
58
|
-
const safeParseAsync = /* @__PURE__*/ _safeParseAsync($ZodRealError);
|
|
59
|
-
|
|
60
|
-
export { _parse, _parseAsync, _safeParse, _safeParseAsync, parse, parseAsync, safeParse, safeParseAsync };
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
|
|
5
|
-
const cuid = /^[cC][^\s-]{8,}$/;
|
|
6
|
-
const cuid2 = /^[0-9a-z]+$/;
|
|
7
|
-
const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
|
|
8
|
-
const xid = /^[0-9a-vA-V]{20}$/;
|
|
9
|
-
const ksuid = /^[A-Za-z0-9]{27}$/;
|
|
10
|
-
const nanoid = /^[a-zA-Z0-9_-]{21}$/;
|
|
11
|
-
/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */
|
|
12
|
-
const duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
|
|
13
|
-
/** Implements ISO 8601-2 extensions like explicit +- prefixes, mixing weeks with other units, and fractional/negative components. */
|
|
14
|
-
const extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
|
|
15
|
-
/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
|
|
16
|
-
const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
|
|
17
|
-
/** Returns a regex for validating an RFC 4122 UUID.
|
|
18
|
-
*
|
|
19
|
-
* @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
|
|
20
|
-
const uuid = (version) => {
|
|
21
|
-
if (!version)
|
|
22
|
-
return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;
|
|
23
|
-
return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
|
|
24
|
-
};
|
|
25
|
-
const uuid4 = /*@__PURE__*/ uuid(4);
|
|
26
|
-
const uuid6 = /*@__PURE__*/ uuid(6);
|
|
27
|
-
const uuid7 = /*@__PURE__*/ uuid(7);
|
|
28
|
-
/** Practical email validation */
|
|
29
|
-
const email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
30
|
-
/** Equivalent to the HTML5 input[type=email] validation implemented by browsers. Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email */
|
|
31
|
-
const html5Email = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
32
|
-
/** The classic emailregex.com regex for RFC 5322-compliant emails */
|
|
33
|
-
const rfc5322Email = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
34
|
-
/** A loose regex that allows Unicode characters, enforces length limits, and that's about it. */
|
|
35
|
-
const unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u;
|
|
36
|
-
const browserEmail = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
37
|
-
// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression
|
|
38
|
-
const _emoji = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
|
39
|
-
function emoji() {
|
|
40
|
-
return new RegExp(_emoji, "u");
|
|
41
|
-
}
|
|
42
|
-
const ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
|
|
43
|
-
const ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/;
|
|
44
|
-
const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
|
|
45
|
-
const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
|
46
|
-
// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript
|
|
47
|
-
const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
48
|
-
const base64url = /^[A-Za-z0-9_-]*$/;
|
|
49
|
-
// based on https://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address
|
|
50
|
-
// export const hostname: RegExp =
|
|
51
|
-
// /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)+([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/;
|
|
52
|
-
const hostname = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;
|
|
53
|
-
const domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
|
|
54
|
-
// https://blog.stevenlevithan.com/archives/validate-phone-number#r4-3 (regex sans spaces)
|
|
55
|
-
const e164 = /^\+(?:[0-9]){6,14}[0-9]$/;
|
|
56
|
-
// const dateSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
|
|
57
|
-
const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
|
|
58
|
-
const date = /*@__PURE__*/ new RegExp(`^${dateSource}$`);
|
|
59
|
-
function timeSource(args) {
|
|
60
|
-
const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
|
|
61
|
-
const regex = typeof args.precision === "number"
|
|
62
|
-
? args.precision === -1
|
|
63
|
-
? `${hhmm}`
|
|
64
|
-
: args.precision === 0
|
|
65
|
-
? `${hhmm}:[0-5]\\d`
|
|
66
|
-
: `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}`
|
|
67
|
-
: `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
68
|
-
return regex;
|
|
69
|
-
}
|
|
70
|
-
function time(args) {
|
|
71
|
-
return new RegExp(`^${timeSource(args)}$`);
|
|
72
|
-
}
|
|
73
|
-
// Adapted from https://stackoverflow.com/a/3143231
|
|
74
|
-
function datetime(args) {
|
|
75
|
-
const time = timeSource({ precision: args.precision });
|
|
76
|
-
const opts = ["Z"];
|
|
77
|
-
if (args.local)
|
|
78
|
-
opts.push("");
|
|
79
|
-
if (args.offset)
|
|
80
|
-
opts.push(`([+-]\\d{2}:\\d{2})`);
|
|
81
|
-
const timeRegex = `${time}(?:${opts.join("|")})`;
|
|
82
|
-
return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
|
83
|
-
}
|
|
84
|
-
const string = (params) => {
|
|
85
|
-
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
86
|
-
return new RegExp(`^${regex}$`);
|
|
87
|
-
};
|
|
88
|
-
const bigint = /^\d+n?$/;
|
|
89
|
-
const integer = /^\d+$/;
|
|
90
|
-
const number = /^-?\d+(?:\.\d+)?/i;
|
|
91
|
-
const boolean = /true|false/i;
|
|
92
|
-
const _null = /null/i;
|
|
93
|
-
const _undefined = /undefined/i;
|
|
94
|
-
// regex for string with no uppercase letters
|
|
95
|
-
const lowercase = /^[^A-Z]*$/;
|
|
96
|
-
// regex for string with no lowercase letters
|
|
97
|
-
const uppercase = /^[^a-z]*$/;
|
|
98
|
-
|
|
99
|
-
exports._emoji = _emoji;
|
|
100
|
-
exports.base64 = base64;
|
|
101
|
-
exports.base64url = base64url;
|
|
102
|
-
exports.bigint = bigint;
|
|
103
|
-
exports.boolean = boolean;
|
|
104
|
-
exports.browserEmail = browserEmail;
|
|
105
|
-
exports.cidrv4 = cidrv4;
|
|
106
|
-
exports.cidrv6 = cidrv6;
|
|
107
|
-
exports.cuid = cuid;
|
|
108
|
-
exports.cuid2 = cuid2;
|
|
109
|
-
exports.date = date;
|
|
110
|
-
exports.datetime = datetime;
|
|
111
|
-
exports.domain = domain;
|
|
112
|
-
exports.duration = duration;
|
|
113
|
-
exports.e164 = e164;
|
|
114
|
-
exports.email = email;
|
|
115
|
-
exports.emoji = emoji;
|
|
116
|
-
exports.extendedDuration = extendedDuration;
|
|
117
|
-
exports.guid = guid;
|
|
118
|
-
exports.hostname = hostname;
|
|
119
|
-
exports.html5Email = html5Email;
|
|
120
|
-
exports.integer = integer;
|
|
121
|
-
exports.ipv4 = ipv4;
|
|
122
|
-
exports.ipv6 = ipv6;
|
|
123
|
-
exports.ksuid = ksuid;
|
|
124
|
-
exports.lowercase = lowercase;
|
|
125
|
-
exports.nanoid = nanoid;
|
|
126
|
-
exports.null = _null;
|
|
127
|
-
exports.number = number;
|
|
128
|
-
exports.rfc5322Email = rfc5322Email;
|
|
129
|
-
exports.string = string;
|
|
130
|
-
exports.time = time;
|
|
131
|
-
exports.ulid = ulid;
|
|
132
|
-
exports.undefined = _undefined;
|
|
133
|
-
exports.unicodeEmail = unicodeEmail;
|
|
134
|
-
exports.uppercase = uppercase;
|
|
135
|
-
exports.uuid = uuid;
|
|
136
|
-
exports.uuid4 = uuid4;
|
|
137
|
-
exports.uuid6 = uuid6;
|
|
138
|
-
exports.uuid7 = uuid7;
|
|
139
|
-
exports.xid = xid;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
const cuid = /^[cC][^\s-]{8,}$/;
|
|
2
|
-
const cuid2 = /^[0-9a-z]+$/;
|
|
3
|
-
const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
|
|
4
|
-
const xid = /^[0-9a-vA-V]{20}$/;
|
|
5
|
-
const ksuid = /^[A-Za-z0-9]{27}$/;
|
|
6
|
-
const nanoid = /^[a-zA-Z0-9_-]{21}$/;
|
|
7
|
-
/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */
|
|
8
|
-
const duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
|
|
9
|
-
/** Implements ISO 8601-2 extensions like explicit +- prefixes, mixing weeks with other units, and fractional/negative components. */
|
|
10
|
-
const extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
|
|
11
|
-
/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
|
|
12
|
-
const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
|
|
13
|
-
/** Returns a regex for validating an RFC 4122 UUID.
|
|
14
|
-
*
|
|
15
|
-
* @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
|
|
16
|
-
const uuid = (version) => {
|
|
17
|
-
if (!version)
|
|
18
|
-
return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;
|
|
19
|
-
return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
|
|
20
|
-
};
|
|
21
|
-
const uuid4 = /*@__PURE__*/ uuid(4);
|
|
22
|
-
const uuid6 = /*@__PURE__*/ uuid(6);
|
|
23
|
-
const uuid7 = /*@__PURE__*/ uuid(7);
|
|
24
|
-
/** Practical email validation */
|
|
25
|
-
const email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
26
|
-
/** Equivalent to the HTML5 input[type=email] validation implemented by browsers. Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email */
|
|
27
|
-
const html5Email = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
28
|
-
/** The classic emailregex.com regex for RFC 5322-compliant emails */
|
|
29
|
-
const rfc5322Email = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
30
|
-
/** A loose regex that allows Unicode characters, enforces length limits, and that's about it. */
|
|
31
|
-
const unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u;
|
|
32
|
-
const browserEmail = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
33
|
-
// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression
|
|
34
|
-
const _emoji = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
|
35
|
-
function emoji() {
|
|
36
|
-
return new RegExp(_emoji, "u");
|
|
37
|
-
}
|
|
38
|
-
const ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
|
|
39
|
-
const ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/;
|
|
40
|
-
const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
|
|
41
|
-
const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
|
42
|
-
// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript
|
|
43
|
-
const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
44
|
-
const base64url = /^[A-Za-z0-9_-]*$/;
|
|
45
|
-
// based on https://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address
|
|
46
|
-
// export const hostname: RegExp =
|
|
47
|
-
// /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)+([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/;
|
|
48
|
-
const hostname = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;
|
|
49
|
-
const domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
|
|
50
|
-
// https://blog.stevenlevithan.com/archives/validate-phone-number#r4-3 (regex sans spaces)
|
|
51
|
-
const e164 = /^\+(?:[0-9]){6,14}[0-9]$/;
|
|
52
|
-
// const dateSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
|
|
53
|
-
const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
|
|
54
|
-
const date = /*@__PURE__*/ new RegExp(`^${dateSource}$`);
|
|
55
|
-
function timeSource(args) {
|
|
56
|
-
const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
|
|
57
|
-
const regex = typeof args.precision === "number"
|
|
58
|
-
? args.precision === -1
|
|
59
|
-
? `${hhmm}`
|
|
60
|
-
: args.precision === 0
|
|
61
|
-
? `${hhmm}:[0-5]\\d`
|
|
62
|
-
: `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}`
|
|
63
|
-
: `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
64
|
-
return regex;
|
|
65
|
-
}
|
|
66
|
-
function time(args) {
|
|
67
|
-
return new RegExp(`^${timeSource(args)}$`);
|
|
68
|
-
}
|
|
69
|
-
// Adapted from https://stackoverflow.com/a/3143231
|
|
70
|
-
function datetime(args) {
|
|
71
|
-
const time = timeSource({ precision: args.precision });
|
|
72
|
-
const opts = ["Z"];
|
|
73
|
-
if (args.local)
|
|
74
|
-
opts.push("");
|
|
75
|
-
if (args.offset)
|
|
76
|
-
opts.push(`([+-]\\d{2}:\\d{2})`);
|
|
77
|
-
const timeRegex = `${time}(?:${opts.join("|")})`;
|
|
78
|
-
return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
|
79
|
-
}
|
|
80
|
-
const string = (params) => {
|
|
81
|
-
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
82
|
-
return new RegExp(`^${regex}$`);
|
|
83
|
-
};
|
|
84
|
-
const bigint = /^\d+n?$/;
|
|
85
|
-
const integer = /^\d+$/;
|
|
86
|
-
const number = /^-?\d+(?:\.\d+)?/i;
|
|
87
|
-
const boolean = /true|false/i;
|
|
88
|
-
const _null = /null/i;
|
|
89
|
-
const _undefined = /undefined/i;
|
|
90
|
-
// regex for string with no uppercase letters
|
|
91
|
-
const lowercase = /^[^A-Z]*$/;
|
|
92
|
-
// regex for string with no lowercase letters
|
|
93
|
-
const uppercase = /^[^a-z]*$/;
|
|
94
|
-
|
|
95
|
-
export { _emoji, base64, base64url, bigint, boolean, browserEmail, cidrv4, cidrv6, cuid, cuid2, date, datetime, domain, duration, e164, email, emoji, extendedDuration, guid, hostname, html5Email, integer, ipv4, ipv6, ksuid, lowercase, nanoid, _null as null, number, rfc5322Email, string, time, ulid, _undefined as undefined, unicodeEmail, uppercase, uuid, uuid4, uuid6, uuid7, xid };
|