Skip to content

Commit f528b54

Browse files
authored
Merge branch 'main' into chore/internet/password-cleanup
2 parents d077eb0 + 01cd057 commit f528b54

File tree

6 files changed

+138
-87
lines changed

6 files changed

+138
-87
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
"c8": "~7.11.0",
100100
"conventional-changelog-cli": "~2.2.2",
101101
"cypress": "~9.5.3",
102-
"esbuild": "~0.14.30",
102+
"esbuild": "~0.14.31",
103103
"eslint": "~8.12.0",
104104
"eslint-config-prettier": "~8.5.0",
105105
"eslint-define-config": "~1.3.0",

pnpm-lock.yaml

Lines changed: 70 additions & 70 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/helpers.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -477,22 +477,19 @@ export class Helpers {
477477
*/
478478
mustache(
479479
str: string | undefined,
480-
data: Record<
481-
string,
482-
string | ((substring: string, ...args: any[]) => string)
483-
>
480+
data: Record<string, string | Parameters<string['replace']>[1]>
484481
): string {
485482
if (str == null) {
486483
return '';
487484
}
488485
for (const p in data) {
489486
const re = new RegExp('{{' + p + '}}', 'g');
490-
str = str.replace(
491-
re,
492-
// TODO @Shinigami92 2022-01-14: Try to improve the type or maybe use `if`
493-
// @ts-expect-error
494-
data[p]
495-
);
487+
const value = data[p];
488+
if (typeof value === 'string') {
489+
str = str.replace(re, value);
490+
} else {
491+
str = str.replace(re, value);
492+
}
496493
}
497494
return str;
498495
}

src/random.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ export class Random {
326326
const randomWordMethod = this.faker.random.arrayElement(wordMethods);
327327

328328
result = randomWordMethod();
329-
} while (bannedChars.some((char) => result.includes(char)));
329+
} while (!result || bannedChars.some((char) => result.includes(char)));
330330

331331
return this.faker.random.arrayElement(result.split(' '));
332332
}

0 commit comments

Comments
 (0)