summary refs log tree commit diff homepage
path: root/src/lib/util.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/util.ts')
-rw-r--r--src/lib/util.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/util.ts b/src/lib/util.ts
new file mode 100644
index 0000000..bd94795
--- /dev/null
+++ b/src/lib/util.ts
@@ -0,0 +1,4 @@
+export const escapeUnicode = (str: string) =>
+  str.replace(/[^\x00-\x7F]/g, (char: string) => '\\u' + char.charCodeAt(0).toString(16).padStart(4, '0'))
+
+export const fixMinecraftUsername = (username: string) => username.replace(/(ยง[A-Z-a-z0-9])/g, '')
1'>redir: Fix typo in noclobber codeHerbert Xu 2018-04-19expand: Fix glibc glob(3) supportHerbert Xu 2018-04-02expand: Fix buffer overflow in expandmetaHerbert Xu 2018-04-02builtin: Move echo space/nl handling into print_escape_strHerbert Xu 2018-04-02builtin: Fix echo performance regressionHerbert Xu 2018-04-02expand: Fix ghost fields with unquoted $@/$*Herbert Xu 2018-04-02parser: Allow newlines within parameter substitutionHerbert Xu 2018-04-02expand: Fix bugs with words connected to the right of $@Herbert Xu 2018-03-25Revert "[BUILTIN] Remove unnecessary restoration of format string in printf"Herbert Xu 2018-03-22parser: Fix backquote support in here-document EOF markHerbert Xu