mod-build 3.7.20-beta.2 → 3.7.21-beta.1

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
+ ## 3.7.21
4
+
5
+ - Added extra conditions for `addTcpaAboveCta` and `addTcpaBelowCta` helper functions to not break when required data is not passed.
6
+
3
7
  ## 3.7.20
4
8
 
5
9
  - Added `addTcpaAboveCta` and `addTcpaBelowCta` helper functions to determine where tcpa should be placed based on trade/branded conditions.
@@ -229,6 +229,9 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
229
229
  {
230
230
  name: 'addTcpaAboveCta',
231
231
  fn: function(page) {
232
+ if (!page || !page.primary_trade) {
233
+ return false;
234
+ }
232
235
  const trade = page.primary_trade.toUpperCase();
233
236
  return trade === 'SOLAR' || trade === 'HOME_SECURITY' || page.isBranded;
234
237
  }
@@ -236,6 +239,9 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
236
239
  {
237
240
  name: 'addTcpaBelowCta',
238
241
  fn: function(page) {
242
+ if (!page || !page.primary_trade) {
243
+ return false;
244
+ }
239
245
  const trade = page.primary_trade.toUpperCase();
240
246
  return trade !== 'SOLAR' && trade !== 'HOME_SECURITY' && !page.isBranded;
241
247
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "3.7.20-beta.2",
3
+ "version": "3.7.21-beta.1",
4
4
  "description": "Share components for S3 sites.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",