tripstorekrabi-shared 1.15.2 → 1.15.4

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.
Files changed (3) hide show
  1. package/booking.js +7 -4
  2. package/package.json +1 -1
  3. package/utils.js +1 -12
package/booking.js CHANGED
@@ -4,7 +4,7 @@ import utc from 'dayjs/plugin/utc.js';
4
4
  import timezone from 'dayjs/plugin/timezone.js';
5
5
  import { PAY_ON_TOUR, calculateTotalOperatorPrice } from './price.js';
6
6
  import { nanoid } from 'nanoid';
7
- import { isHotelPickup, isHotelDropOff } from './utils.js';
7
+ import { isHotelPickup } from './utils.js';
8
8
 
9
9
  dayjs.extend(advancedFormat);
10
10
  dayjs.extend(utc);
@@ -279,11 +279,14 @@ export function getStartingPointMessage(booking, product) {
279
279
  text += ' on the ' + date;
280
280
  }
281
281
 
282
- if (booking.dropOffHotel && isHotelDropOff(booking.startingPointDescription)) {
283
- text += ' with transfer to ' + booking.dropOffHotel;
282
+ text += ". ";
283
+
284
+ let transferTo = "with transfer to";
285
+ if (booking.productDescription.includes(transferTo)) {
286
+ text += "Your booking includes a " + booking.productDescription.substring(booking.productDescription.indexOf(transferTo)).replace(transferTo, "transfer to") + '. ';
284
287
  }
285
288
 
286
- text += '. Please watch out for the staff of ' + booking.operator + '.';
289
+ text += 'Please watch out for the staff of ' + booking.operator + '.';
287
290
 
288
291
  if (booking.googleMapLocation?.length > 0) {
289
292
  text += `\n\n${isHotelPickup(booking.startingPointDescription)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tripstorekrabi-shared",
3
- "version": "1.15.2",
3
+ "version": "1.15.4",
4
4
  "description": "Shared library for Trip Store Krabi",
5
5
  "author": "Stefan Sommer <tonprince@gmail.com>",
6
6
  "repository": {
package/utils.js CHANGED
@@ -36,18 +36,7 @@ export function validateEmail(email) {
36
36
  }
37
37
 
38
38
  export function resizeGoogleImage(image, size) {
39
- return image
40
- .replace(/\/w.\d+-.\d+-p\//, '/' + size + '/')
41
- .replace(/\/w.\d+-.\d+-c\//, '/' + size + '/')
42
- .replace(/\/w.\d+-.\d+-no\//, '/' + size + '/')
43
- .replace(/\/w.\d+-.\d+\//, '/' + size + '/')
44
- .replace(/\/s.\d+\//, '/' + size + '/')
45
- .replace(/\=w.\d+-.\d+-p/, '=' + size)
46
- .replace(/\=w.\d+-.\d+-c/, '=' + size)
47
- .replace(/\=w.\d+-.\d+-no/, '=' + size)
48
- .replace(/\=w.\d+-.\d+/, '=' + size)
49
- .replace(/\=s.\d+/, '=' + size)
50
- .replace(/\=s.\d+/, '=' + size);
39
+ return image.replace(/(?=w|h|s)(w.\d+)?(-)?(h.\d+)?(s.\d+)?(-p)?(-c)?(-s)?(-no)?/, size)
51
40
  }
52
41
 
53
42
  export function resizeStorageImage(path, size) {