MCPcopy Create free account
hub / github.com/bhaskatripathi/Text2Diagram / parseCodeFromMessage

Function parseCodeFromMessage

lib/utils.ts:91–100  ·  view source on GitHub ↗
(message: string)

Source from the content-addressed store, hash-verified

89};
90
91export const parseCodeFromMessage = (message: string) => {
92 const regex = /```(?:mermaid)?\s*([\s\S]*?)```/;
93 const match = message.match(regex);
94
95 if (match) {
96 return match[1];
97 } else {
98 return message;
99 }
100};
101
102export const serializeCode = (code: string) => {
103 const state = {

Callers 2

handleSubmitFunction · 0.90
serializeCodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected