mod-build 3.7.21 → 3.7.22-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,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.7.22
4
+ - Added extra conditions for `addTcpaAboveCta` and `addTcpaBelowCta` helper functions to not break when required data is not passed.
5
+
3
6
  ## 3.7.21
4
7
 
5
8
  - Added `GUTTERS` & `GUTTER_COVERS` to the `addTcpaAboveCta` and `addTcpaBelowCta` configurations.
@@ -231,6 +231,9 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
231
231
  {
232
232
  name: 'addTcpaAboveCta',
233
233
  fn: function(page) {
234
+ if (!page || !page.primary_trade) {
235
+ return false;
236
+ }
234
237
  const trade = page.primary_trade.replace(/\s+/g, '_').toUpperCase();
235
238
  return tradesWithTcpaAboveCta.includes(trade) || page.isBranded;
236
239
  }
@@ -238,8 +241,10 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
238
241
  {
239
242
  name: 'addTcpaBelowCta',
240
243
  fn: function(page) {
244
+ if (!page || !page.primary_trade) {
245
+ return false;
246
+ }
241
247
  const trade = page.primary_trade.replace(/\s+/g, '_').toUpperCase();
242
-
243
248
  return !tradesWithTcpaAboveCta.includes(trade) && !page.isBranded;
244
249
  }
245
250
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "3.7.21",
3
+ "version": "3.7.22-beta.2",
4
4
  "description": "Share components for S3 sites.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",