tripstorekrabi-shared 1.3.0 → 1.4.0
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/package.json +1 -1
- package/utils.js +3 -4
package/package.json
CHANGED
package/utils.js
CHANGED
|
@@ -404,7 +404,7 @@ export function getItemSummary(item, product) {
|
|
|
404
404
|
return summary;
|
|
405
405
|
}
|
|
406
406
|
|
|
407
|
-
export function validateSchedule(schedule, schedules = [],
|
|
407
|
+
export function validateSchedule(schedule, schedules = [], context) {
|
|
408
408
|
if (schedule === "?") {
|
|
409
409
|
return true;
|
|
410
410
|
} else if (schedule.indexOf(" - ") != -1) {
|
|
@@ -413,13 +413,12 @@ export function validateSchedule(schedule, schedules = [], boolean = false, cont
|
|
|
413
413
|
var to = times[1];
|
|
414
414
|
|
|
415
415
|
if (!SCHEDULE_PATTERN.test(from) || !SCHEDULE_PATTERN.test(to) || (from === to)) {
|
|
416
|
-
return
|
|
416
|
+
return context.createError({ message: "Invalid schedule format: for example use '09:00 - 15:30'", path: context.path, });
|
|
417
417
|
}
|
|
418
418
|
} else {
|
|
419
|
-
return
|
|
419
|
+
return context.createError({ message: "Invalid schedule format: for example use '09:00 - 15:30'", path: context.path, });
|
|
420
420
|
}
|
|
421
421
|
|
|
422
|
-
|
|
423
422
|
if (schedule != "") {
|
|
424
423
|
if (schedules.length > 0 && schedules.indexOf(schedule) == -1) {
|
|
425
424
|
return context.createError({
|