gd-bs 6.6.23 → 6.6.25
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/build/icons/generate.js +2 -2
- package/dist/gd-bs-icons.js +1 -1
- package/dist/gd-bs-icons.min.js +1 -1
- package/generateIcons.js +2 -2
- package/package.json +1 -1
- package/src/icons/generate.ts +2 -2
package/generateIcons.js
CHANGED
|
@@ -137,12 +137,12 @@ fs.readdir(dirIcons, function (err, files) {
|
|
|
137
137
|
'// Generates the html for an icon',
|
|
138
138
|
'export const generateIcon = (svg: string, height: number = 32, width: number = 32, className?: string, placeholders?: number) => {',
|
|
139
139
|
'\t// See if placeholders exist',
|
|
140
|
-
'\tif (placeholders > 0) {',
|
|
140
|
+
'\tif (typeof(placeholders) === "number" && placeholders > 0) {',
|
|
141
141
|
'\t\t// Parse the number of placeholders',
|
|
142
142
|
'\t\tfor (let i = 0; i < placeholders; i++) {',
|
|
143
143
|
'\t\t\tlet regex = new RegExp("\\\\{" + i + "\\\\}", "g");\n',
|
|
144
144
|
'\t\t\t// Replace the placeholder',
|
|
145
|
-
'\t\t\tsvg = svg.replace(regex, Date.now().toString());',
|
|
145
|
+
'\t\t\tsvg = svg.replace(regex, Math.floor(Date.now() * Math.random()).toString());',
|
|
146
146
|
'\t\t}',
|
|
147
147
|
'\t}\n',
|
|
148
148
|
'\t// Get the icon element',
|
package/package.json
CHANGED
package/src/icons/generate.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// Generates the html for an icon
|
|
2
2
|
export const generateIcon = (svg: string, height: number = 32, width: number = 32, className?: string, placeholders?: number) => {
|
|
3
3
|
// See if placeholders exist
|
|
4
|
-
if (placeholders > 0) {
|
|
4
|
+
if (typeof(placeholders) === "number" && placeholders > 0) {
|
|
5
5
|
// Parse the number of placeholders
|
|
6
6
|
for (let i = 0; i < placeholders; i++) {
|
|
7
7
|
let regex = new RegExp("\\{" + i + "\\}", "g");
|
|
8
8
|
|
|
9
9
|
// Replace the placeholder
|
|
10
|
-
svg = svg.replace(regex, Date.now().toString());
|
|
10
|
+
svg = svg.replace(regex, Math.floor(Date.now() * Math.random()).toString());
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|