MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / isPureEmoji

Function isPureEmoji

packages/node-runtime/src/ai/preprocessor/pipeline.ts:168–177  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

166])
167
168function isPureEmoji(str: string): boolean {
169 const stripped = str
170 .replace(/\p{Emoji_Presentation}/gu, '')
171 .replace(/\p{Extended_Pictographic}/gu, '')
172 .replace(/\u200d/g, '')
173 .replace(/\ufe0f/g, '')
174 .replace(/\u20e3/g, '')
175 .replace(/\s/g, '')
176 return stripped.length === 0
177}
178
179function applyMergeConsecutive<T extends PreprocessableMessage>(messages: T[], windowSeconds: number): T[] {
180 if (messages.length <= 1) return messages

Callers 1

applyDenoiseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected