mod-build 4.0.8 → 4.0.9

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,3 +1,8 @@
1
+ ## 4.0.9
2
+
3
+ - Updating the TCPA fetch to replace the `<%=company_name%>` if one is sent through
4
+
5
+
1
6
  ## 4.0.8
2
7
 
3
8
  - Updating the build WriteBundle() to also update our CSS paths (if applicable)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "4.0.8",
3
+ "version": "4.0.9",
4
4
  "description": "Share components for S3 sites.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -73,6 +73,7 @@ const getDefaultFormFieldConfig = async (config, folder = 'accessible-components
73
73
 
74
74
  const fetchTcpaFromSitegenie = async (config, tempConfig) => {
75
75
  const company = config.company_name;
76
+ const companyPlaceholder = "<%=company_name%>";
76
77
  const website = config.website_name;
77
78
  const c_level = config.cLevel || 'default';
78
79
  const affiliateKey = config.affiliateKey || 0;
@@ -101,6 +102,9 @@ const fetchTcpaFromSitegenie = async (config, tempConfig) => {
101
102
  let finalTCPA = await (company === 'Modernize' || config.useModernizeInTCPA) ? responseJson.tcpa.replace(/QuinStreet/g, 'Modernize') : responseJson.tcpa;
102
103
  const removeInlineStyleRegex = / style="[^"]*"/g;
103
104
  finalTCPA = finalTCPA.replace(removeInlineStyleRegex, '');
105
+ if (finalTCPA.includes(companyPlaceholder)) {
106
+ finalTCPA = finalTCPA.replace(new RegExp(companyPlaceholder, 'g'), company);
107
+ }
104
108
  tempConfig.tcpaText = finalTCPA;
105
109
  resolve(finalTCPA);
106
110
  })