@tripsam/onboarding 1.0.18 → 1.0.20
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 +8 -5
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -136,9 +136,12 @@ __export(slot_exports, {
|
|
|
136
136
|
update: () => update2
|
|
137
137
|
});
|
|
138
138
|
var import_zod4 = require("zod");
|
|
139
|
-
var
|
|
140
|
-
|
|
141
|
-
const
|
|
139
|
+
var TIME_12H = /^(0?[1-9]|1[0-2]):([0-5][0-9])(?:[\u00A0\u202F\s]*)?(AM|PM)$/i;
|
|
140
|
+
var time12h = import_zod4.z.string().trim().regex(TIME_12H, "Use format hh:mm AM/PM").transform((v) => {
|
|
141
|
+
const m = v.match(TIME_12H);
|
|
142
|
+
const hh = m[1];
|
|
143
|
+
const mm = m[2];
|
|
144
|
+
const meridian = m[3].toUpperCase();
|
|
142
145
|
let h = parseInt(hh, 10) % 12;
|
|
143
146
|
if (meridian === "PM") h += 12;
|
|
144
147
|
return h * 60 + parseInt(mm, 10);
|
|
@@ -154,8 +157,8 @@ var update2 = import_zod4.z.object({
|
|
|
154
157
|
var create = import_zod4.z.object({
|
|
155
158
|
name: import_zod4.z.string().trim().nonempty("required"),
|
|
156
159
|
description: import_zod4.z.string().trim().optional(),
|
|
157
|
-
startTime:
|
|
158
|
-
endTime:
|
|
160
|
+
startTime: time12h,
|
|
161
|
+
endTime: time12h,
|
|
159
162
|
minHour: import_zod4.z.coerce.number("invalid")
|
|
160
163
|
});
|
|
161
164
|
var me3 = import_zod4.z.object({
|
package/dist/index.d.cts
CHANGED
|
@@ -172,8 +172,8 @@ declare const update: z.ZodObject<{
|
|
|
172
172
|
declare const create: z.ZodObject<{
|
|
173
173
|
name: z.ZodString;
|
|
174
174
|
description: z.ZodOptional<z.ZodString>;
|
|
175
|
-
startTime: z.ZodString
|
|
176
|
-
endTime: z.ZodString
|
|
175
|
+
startTime: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
176
|
+
endTime: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
177
177
|
minHour: z.ZodCoercedNumber<unknown>;
|
|
178
178
|
}, z.core.$strip>;
|
|
179
179
|
declare const me: z.ZodObject<{
|
package/dist/index.d.ts
CHANGED
|
@@ -172,8 +172,8 @@ declare const update: z.ZodObject<{
|
|
|
172
172
|
declare const create: z.ZodObject<{
|
|
173
173
|
name: z.ZodString;
|
|
174
174
|
description: z.ZodOptional<z.ZodString>;
|
|
175
|
-
startTime: z.ZodString
|
|
176
|
-
endTime: z.ZodString
|
|
175
|
+
startTime: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
176
|
+
endTime: z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>;
|
|
177
177
|
minHour: z.ZodCoercedNumber<unknown>;
|
|
178
178
|
}, z.core.$strip>;
|
|
179
179
|
declare const me: z.ZodObject<{
|
package/dist/index.js
CHANGED
|
@@ -113,9 +113,12 @@ __export(slot_exports, {
|
|
|
113
113
|
update: () => update2
|
|
114
114
|
});
|
|
115
115
|
import { z as z4 } from "zod";
|
|
116
|
-
var
|
|
117
|
-
|
|
118
|
-
const
|
|
116
|
+
var TIME_12H = /^(0?[1-9]|1[0-2]):([0-5][0-9])(?:[\u00A0\u202F\s]*)?(AM|PM)$/i;
|
|
117
|
+
var time12h = z4.string().trim().regex(TIME_12H, "Use format hh:mm AM/PM").transform((v) => {
|
|
118
|
+
const m = v.match(TIME_12H);
|
|
119
|
+
const hh = m[1];
|
|
120
|
+
const mm = m[2];
|
|
121
|
+
const meridian = m[3].toUpperCase();
|
|
119
122
|
let h = parseInt(hh, 10) % 12;
|
|
120
123
|
if (meridian === "PM") h += 12;
|
|
121
124
|
return h * 60 + parseInt(mm, 10);
|
|
@@ -131,8 +134,8 @@ var update2 = z4.object({
|
|
|
131
134
|
var create = z4.object({
|
|
132
135
|
name: z4.string().trim().nonempty("required"),
|
|
133
136
|
description: z4.string().trim().optional(),
|
|
134
|
-
startTime:
|
|
135
|
-
endTime:
|
|
137
|
+
startTime: time12h,
|
|
138
|
+
endTime: time12h,
|
|
136
139
|
minHour: z4.coerce.number("invalid")
|
|
137
140
|
});
|
|
138
141
|
var me3 = z4.object({
|