Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hibiyasleep committed Feb 17, 2025
1 parent c97a292 commit bc2d600
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/string-util/string-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ export function isValidEmail(str: string): boolean {
export function splitTags(str: string, separator: string | RegExp = ','): Tag[] {
return str
.split(separator)
.filter((_) => _.length)
.map((text) => ({ text: text.trim() }));
.map((text) => ({ text: text.trim() }))
.filter((_) => _.text);
}

/** @deprecated do .split().map().filter() yourself */
Expand All @@ -186,7 +186,7 @@ export function splitString(str: string, separator = ','): string[] {
}

export function joinTags(tags: Readonly<Tag[]>, separator = ','): string {
return tags.map((tag) => tag.text).join(separator);
return tags.map((tag) => tag.text?.trim()).filter((text) => text).join(separator);

Check failure on line 189 in src/string-util/string-util.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Replace `.map((tag)·=>·tag.text?.trim()).filter((text)·=>·text)` with `⏎····.map((tag)·=>·tag.text?.trim())⏎····.filter((text)·=>·text)⏎····`
}

/** @deprecated do .map().join() yourself */
Expand Down

0 comments on commit bc2d600

Please sign in to comment.