mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
added state message formatting
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
function formatState(str) {
|
||||
return (
|
||||
str
|
||||
.replace(/-/g, " ")
|
||||
.split(" ")
|
||||
.map((word) => {
|
||||
word = word.toLowerCase();
|
||||
if (word === "ipfs" || word === "ipns") {
|
||||
return word.toUpperCase();
|
||||
} else {
|
||||
return word.charAt(0).toUpperCase() + word.slice(1);
|
||||
}
|
||||
})
|
||||
.join(" ") + "..."
|
||||
);
|
||||
}
|
||||
|
||||
export default formatState;
|
||||
Reference in New Issue
Block a user