MCPcopy
hub / github.com/ChatGPTNextWeb/NextChat / trimTopic

Function trimTopic

app/utils.ts:16–26  ·  view source on GitHub ↗
(topic: string)

Source from the content-addressed store, hash-verified

14import { ModelSize } from "./typing";
15
16export function trimTopic(topic: string) {
17 // Fix an issue where double quotes still show in the Indonesian language
18 // This will remove the specified punctuation from the end of the string
19 // and also trim quotes from both the start and end if they exist.
20 return (
21 topic
22 // fix for gemini
23 .replace(/^["“”*]+|["“”*]+$/g, "")
24 .replace(/[,。!?”“"、,.!?*]*$/, "")
25 );
26}
27
28export async function copyToClipboard(text: string) {
29 try {

Callers 1

onFinishFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected