aboutsummaryrefslogtreecommitdiff
path: root/webAO/encoding.ts
diff options
context:
space:
mode:
authorstonedDiscord <Tukz@gmx.de>2023-09-20 13:10:36 +0200
committerstonedDiscord <Tukz@gmx.de>2023-09-20 13:10:36 +0200
commitdda92bd41f4bee11e2cc5de265ce4fbf5221f1ff (patch)
treebcb0f8121955ff815758b30ec4e24a1e6bde4fba /webAO/encoding.ts
parent59028dd4046ad0715d80be8d1ed0031f20f05b7a (diff)
autoformat with eslint
Diffstat (limited to 'webAO/encoding.ts')
-rw-r--r--webAO/encoding.ts36
1 files changed, 18 insertions, 18 deletions
diff --git a/webAO/encoding.ts b/webAO/encoding.ts
index 697e1d0..c878cb5 100644
--- a/webAO/encoding.ts
+++ b/webAO/encoding.ts
@@ -3,11 +3,11 @@
* @param {string} estring the string to be escaped
*/
export function escapeChat(estring: string): string {
- return estring
- .replaceAll('#', '<num>')
- .replaceAll('&', '<and>')
- .replaceAll('%', '<percent>')
- .replaceAll('$', '<dollar>');
+ return estring
+ .replaceAll('#', '<num>')
+ .replaceAll('&', '<and>')
+ .replaceAll('%', '<percent>')
+ .replaceAll('$', '<dollar>');
}
/**
@@ -15,11 +15,11 @@ export function escapeChat(estring: string): string {
* @param {string} estring the string to be unescaped
*/
export function unescapeChat(estring: string): string {
- return estring
- .replaceAll('<num>', '#')
- .replaceAll('<and>', '&')
- .replaceAll('<percent>', '%')
- .replaceAll('<dollar>', '$');
+ return estring
+ .replaceAll('<num>', '#')
+ .replaceAll('<and>', '&')
+ .replaceAll('<percent>', '%')
+ .replaceAll('<dollar>', '$');
}
/**
@@ -29,12 +29,12 @@ export function unescapeChat(estring: string): string {
* @param {string} unsafe an unsanitized string
*/
export function safeTags(unsafe: string): string {
- if (unsafe) {
- return unsafe
- .replaceAll('>', '>')
- .replaceAll('<', '<');
- }
- return '';
+ if (unsafe) {
+ return unsafe
+ .replaceAll('>', '>')
+ .replaceAll('<', '<');
+ }
+ return '';
}
/**
@@ -51,6 +51,6 @@ export function decodeChat(estring: string): string {
* @param {string} msg chat message to prepare for display
*/
export function prepChat(msg: string): string {
- // TODO: make this less awful
- return safeTags(unescapeChat(decodeChat(msg)));
+ // TODO: make this less awful
+ return safeTags(unescapeChat(decodeChat(msg)));
}