tripstorekrabi-shared 1.9.4 → 1.9.6
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 +7 -1
package/package.json
CHANGED
package/utils.js
CHANGED
|
@@ -450,7 +450,7 @@ export function validatePickupTime(pickupTime, schedule = "", context) {
|
|
|
450
450
|
export function isPickupTimeBeforeDepartureTime(schedule, pickupTime) {
|
|
451
451
|
let departureTime = schedule.split(" - ")[0];
|
|
452
452
|
if (pickupTime === "?" || schedule === "?") {
|
|
453
|
-
return
|
|
453
|
+
return true;
|
|
454
454
|
} else if (pickupTime.indexOf(" - ") != -1) {
|
|
455
455
|
let times = pickupTime.split(" - ");
|
|
456
456
|
pickupTime = times[0];
|
|
@@ -590,4 +590,10 @@ export function hasCustomPricing(pricing, bookingType) {
|
|
|
590
590
|
|
|
591
591
|
export function truncate(str, num) {
|
|
592
592
|
return str.length > num ? str.slice(0, num - 1) : str;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
export function isJSON(text) {
|
|
596
|
+
return /^[\],:{}\s]*$/.test(text.replace(/\\["\\\/bfnrtu]/g, '@').
|
|
597
|
+
replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
|
|
598
|
+
replace(/(?:^|:|,)(?:\s*\[)+/g, ''));
|
|
593
599
|
}
|