@explorins/pers-sdk-react-native 2.3.4 → 2.3.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.js +7 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4261,6 +4261,7 @@ function isBookingStatusValid(status, requirement) {
|
|
|
4261
4261
|
* @param checkOutDate - Booking end date
|
|
4262
4262
|
* @param referenceDate - Date to compare against (defaults to current date)
|
|
4263
4263
|
* @returns Computed booking status
|
|
4264
|
+
* @throws Error if checkOutDate is not after checkInDate
|
|
4264
4265
|
*
|
|
4265
4266
|
* @example
|
|
4266
4267
|
* // Today is June 5
|
|
@@ -4277,6 +4278,11 @@ function computeBookingStatus(checkInDate, checkOutDate, referenceDate = new Dat
|
|
|
4277
4278
|
now.setHours(0, 0, 0, 0);
|
|
4278
4279
|
checkIn.setHours(0, 0, 0, 0);
|
|
4279
4280
|
checkOut.setHours(0, 0, 0, 0);
|
|
4281
|
+
// Defensive validation: checkOut must be after checkIn
|
|
4282
|
+
// This catches invalid data from frontend or data integrity issues
|
|
4283
|
+
if (checkOut <= checkIn) {
|
|
4284
|
+
throw new Error(`Invalid booking dates: checkOut (${checkOut.toISOString()}) must be after checkIn (${checkIn.toISOString()})`);
|
|
4285
|
+
}
|
|
4280
4286
|
// Checkout day itself counts as still active (guest there until end of day)
|
|
4281
4287
|
if (checkOut < now) {
|
|
4282
4288
|
return 'past';
|
|
@@ -12115,7 +12121,7 @@ class DefaultAuthProvider {
|
|
|
12115
12121
|
/** SDK package name */
|
|
12116
12122
|
const SDK_NAME = "@explorins/pers-sdk";
|
|
12117
12123
|
/** SDK version - injected from package.json at build time */
|
|
12118
|
-
const SDK_VERSION = "2.3.
|
|
12124
|
+
const SDK_VERSION = "2.3.10";
|
|
12119
12125
|
/** Full SDK identifier for headers */
|
|
12120
12126
|
const SDK_USER_AGENT = `${SDK_NAME}/${SDK_VERSION}`;
|
|
12121
12127
|
|