-
Notifications
You must be signed in to change notification settings - Fork 0
/
remove-emoji.ts
42 lines (36 loc) · 1.29 KB
/
remove-emoji.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { readFile } from "fs/promises";
async function main() {
const users: {
userId: string;
displayName: string;
pictureUrl: string;
language: string;
nickname?: string;
chatId: string;
chatUrl: string;
}[] = JSON.parse(await readFile("data-last.json", "utf-8"));
const result = users.map((user) => {
if (!user.nickname) {
return user;
}
const nickname = user.nickname
.replace(
/((💛)|(🎅)|(🎄)|(セ🎍)|(🍎)|(@)|(@)|(💖)|(🎄)|(🍓)|(セ💛L)|(L1)|(L2)|(L🎄)|(M1)|(M1)|(M2)|(M2)|(m見)|(hク)|(hく)|(h見)|(h2)|(h正)|(🌼)|(セL)|(セM1)|(!)|(豊橋)|(豊川)|(正🎍)|(ク💛M)|(正月)|(正ク)|(正ク🎍🎍🎅)|(L 連)|(ポ!)|(ポL2)|(ポ💖)|(ポク)|(ポ🍎)|(クく)|(※くく)|(ク正)|(ミ見)).*$/,
""
)
.replace(/(( 連)|(h)|(h)|(ポ)|(セ)|(ク)|(M))$/, "")
.replace(/((🎍)|(️)|(※))/g, "")
.replace("洋子く", "洋子")
.replace("弥寿子ク", "弥寿子")
.replace("啓子ク正", "啓子")
.replace("晴世h", "晴世")
.replace("美佳く", "美佳")
.trim();
return {
...user,
nickname,
};
});
console.log(JSON.stringify(result, null, 2));
}
main().catch((err) => console.error(err));