@caweb/html-webpack-plugin 1.5.4 → 1.5.5

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.
@@ -1,6 +1,15 @@
1
1
  export default function replace(value, search, replace){
2
- // if value is passed
2
+ let response = '';
3
+
4
+ // if parameter is passed
3
5
  if( value && value.length ){
4
- return value.replace(new RegExp(search, "g"), replace);
6
+ response = value.replace(new RegExp(search, "g"), replace);
5
7
  }
8
+
9
+ // if nested content exists
10
+ if( value.fn && value.fn().length ){
11
+ response += value.fn().replace(new RegExp(search, "g"), replace);
12
+ }
13
+
14
+ return response;
6
15
  }
@@ -1,6 +1,16 @@
1
- export default function toLower(value){
2
- // if value is passed
1
+ export default function toLower(value, options){
2
+ let response = '';
3
+
4
+ // if parameter is passed
3
5
  if( value && value.length ){
4
- return value.toLowerCase();
6
+ response = value.toLowerCase();
5
7
  }
8
+
9
+ // if nested content exists
10
+ if( (value.fn && value.fn().length) || (options.fn && options.fn().length ) ){
11
+ let content = value.fn ? value.fn() : options.fn();
12
+ response += content.toLowerCase();
13
+ }
14
+
15
+ return response;
6
16
  }
@@ -1,6 +1,16 @@
1
- export default function toTitleCase(value){
2
- // if value is passed
1
+ export default function toTitleCase(value, options){
2
+ let response = '';
3
+
4
+ // if parameter is passed
3
5
  if( value && value.length ){
4
- return value.split(' ').map( w => w.charAt(0).toUpperCase() + w.slice(1) ).join(' ')
6
+ response = value.split(' ').map( w => w.charAt(0).toUpperCase() + w.slice(1) ).join(' ');
5
7
  }
8
+
9
+ // if nested content exists
10
+ if( (value.fn && value.fn().length) || (options.fn && options.fn().length ) ){
11
+ let content = value.fn ? value.fn() : options.fn();
12
+ response += content.split(' ').map( w => w.charAt(0).toUpperCase() + w.slice(1) ).join(' ');
13
+ }
14
+
15
+ return response;
6
16
  }
@@ -1,6 +1,16 @@
1
- export default function toUpper(value){
2
- // if value is passed
1
+ export default function toUpper(value, options){
2
+ let response = '';
3
+
4
+ // if parameter is passed
3
5
  if( value && value.length ){
4
- return value.toUpperCase();
6
+ response = value.toUpperCase();
5
7
  }
8
+
9
+ // if nested content exists
10
+ if( (value.fn && value.fn().length) || (options.fn && options.fn().length ) ){
11
+ let content = value.fn ? value.fn() : options.fn();
12
+ response += content.toUpperCase();
13
+ }
14
+
15
+ return response;
6
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caweb/html-webpack-plugin",
3
- "version": "1.5.4",
3
+ "version": "1.5.5",
4
4
  "description": "CAWebPublishing Sample Page and Configurations",
5
5
  "main": "index.js",
6
6
  "type": "module",