gd-bs 6.6.20 → 6.6.21

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/generateIcons.js CHANGED
@@ -140,8 +140,9 @@ fs.readdir(dirIcons, function (err, files) {
140
140
  '\tif (placeholders > 0) {',
141
141
  '\t\t// Parse the number of placeholders',
142
142
  '\t\tfor (let i = 0; i < placeholders; i++) {',
143
- '\t\t// Replace the placeholder',
144
- '\t\tsvg = svg.replace("{" + i + "}", Date.now().toString());',
143
+ '\t\t\tlet regex = new RegExp("/\\{" + i + "\\}/g");\n',
144
+ '\t\t\t// Replace the placeholder',
145
+ '\t\t\tsvg = svg.replace(regex, Date.now().toString());',
145
146
  '\t\t}',
146
147
  '\t}\n',
147
148
  '\t// Get the icon element',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gd-bs",
3
- "version": "6.6.20",
3
+ "version": "6.6.21",
4
4
  "description": "Bootstrap JavaScript, TypeScript and Web Components library.",
5
5
  "main": "build/index.js",
6
6
  "typings": "src/index.d.ts",
@@ -4,8 +4,10 @@ export const generateIcon = (svg: string, height: number = 32, width: number = 3
4
4
  if (placeholders > 0) {
5
5
  // Parse the number of placeholders
6
6
  for (let i = 0; i < placeholders; i++) {
7
- // Replace the placeholder
8
- svg = svg.replace("{" + i + "}", Date.now().toString());
7
+ let regex = new RegExp("/\{" + i + "\}/g");
8
+
9
+ // Replace the placeholder
10
+ svg = svg.replace(regex, Date.now().toString());
9
11
  }
10
12
  }
11
13