mod-build 4.0.54 → 4.0.55

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.55
4
+
5
+ - Added extra conditions for `addTcpaAboveCta` and `addTcpaBelowCta` helper functions to not break when required data is not passed.
6
+
3
7
  ## 4.0.54
4
8
 
5
9
  - Added `GUTTERS` & `GUTTER_COVERS` to the `addTcpaAboveCta` and `addTcpaBelowCta` configurations.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "4.0.54",
3
+ "version": "4.0.55",
4
4
  "description": "Share components for S3 sites.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -188,6 +188,9 @@ export const handlebarsHelpers = [
188
188
  {
189
189
  name: 'addTcpaAboveCta',
190
190
  fn: function(page) {
191
+ if (!page || !page.primary_trade) {
192
+ return false;
193
+ }
191
194
  const trade = page.primary_trade.replace(/\s+/g, '_').toUpperCase();
192
195
  return tradesWithTcpaAboveCta.includes(trade) || page.isBranded;
193
196
  }
@@ -195,8 +198,10 @@ export const handlebarsHelpers = [
195
198
  {
196
199
  name: 'addTcpaBelowCta',
197
200
  fn: function(page) {
201
+ if (!page || !page.primary_trade) {
202
+ return false;
203
+ }
198
204
  const trade = page.primary_trade.replace(/\s+/g, '_').toUpperCase();
199
-
200
205
  return !tradesWithTcpaAboveCta.includes(trade) && !page.isBranded;
201
206
  }
202
207
  }