mod-build 4.0.74 → 4.0.75-beta.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.0.75
4
+
5
+ - Updated the seasonal changes regex to include "or" conditions when swapping heating and ac in the strings.
6
+
3
7
  ## 4.0.74
4
8
 
5
9
  - Added support for seasonal changes in all steps objects.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "4.0.74",
3
+ "version": "4.0.75-beta.2",
4
4
  "description": "Share components for S3 sites.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -68,9 +68,10 @@ export default async function(config) {
68
68
  const heating = '(Heating|heating|calentadores|Calentadores|calefactores|Calefactores)';
69
69
  const and = '(\\s&\\s|\\sand\\s|and|\\sy\\s)'; // eslint-disable-line no-useless-escape
70
70
  const ac = '(AC|Cooling|cooling|aires.*?acondicionados|Aires.*?Acondicionados)';
71
+ const or = '(\\sor\\s|or|\\so\\s|o|\\sÓ\\s|Ó|\\só\\s|ó)';
71
72
  const spaces = '.*?';
72
73
 
73
- const regex = new RegExp(`${heating}${spaces}${and}${spaces}${ac}`, 'gm');
74
+ const regex = new RegExp(`(${heating})${spaces}(${and}|${or})${spaces}(${ac})`, 'gm');
74
75
  // Find and reverse the required words in the string using regex group capture
75
76
  const processedData = data.replaceAll(regex, '$3 $2 $1');
76
77
  // Convert data into JSON