Skip to content

Commit d66db5e

Browse files
Resolve figletPromise with "" instead of undefined
The figletPromise method was resolving with a `string | undefined` when only a `string` was allowed; this resolves with `""` instead of `undefined`.
1 parent a108f45 commit d66db5e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/template/ts/src/util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ const figletPromise = (txt: string, options: any): Promise<string> =>
4040
figlet.text(
4141
txt,
4242
options,
43-
(error: Error | null, result: string | undefined) => {
43+
(error: Error | null, result?: string) => {
4444
if (error) {
4545
return reject(error);
4646
}
4747

48-
resolve(result);
48+
resolve(result ?? "");
4949
}
5050
)
5151
);

0 commit comments

Comments
 (0)