Skip to content

Commit

Permalink
added TextUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
yuko1101 committed Feb 4, 2024
1 parent 41ee0da commit 1363f88
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# 1.3.1
- Added TextUtils to make it easier to modify formatted texts.
# 1.3.0
**This version includes Breaking Changes**
- Removed StarRailUser#playStationAccount.
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import Path from "./models/Path";
import StatProperty, { StatPropertyValue } from "./models/StatProperty";
import StarRailUser from "./models/StarRailUser";
import UserIcon from "./models/UserIcon";
import TextUtils from "./utils/text_utils";

// classes
export {
Expand Down Expand Up @@ -72,6 +73,7 @@ export {
StatPropertyValue,
StarRailUser,
UserIcon,
TextUtils,
};

// typedefs
Expand Down
7 changes: 7 additions & 0 deletions src/utils/text_utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class TextUtils {
static removeRuby(text: string): string {
return text.replace(/{RUBY_B#.+?}(.+?){RUBY_E#}/g, "$1");
}
}

export default TextUtils;

0 comments on commit 1363f88

Please sign in to comment.