Skip to content

Commit

Permalink
fix(fancy): fallback whenIntl is unavailable (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcaaa31928 authored Dec 23, 2024
1 parent 0502452 commit d9b58df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/reporters/fancy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ const TYPE_ICONS: { [k in LogType]?: string } = {

function stringWidth(str: string) {
// https://github.com/unjs/consola/issues/204
if (!Intl.Segmenter) {
const hasICU = typeof Intl === "object";
if (!hasICU || !Intl.Segmenter) {
return stripAnsi(str).length;
}
return _stringWidth(str);
Expand Down

0 comments on commit d9b58df

Please sign in to comment.