MCPcopy Index your code
hub / github.com/Lemoncode/fonk / parseMessage

Function parseMessage

src/validators/validators.helpers.ts:8–17  ·  view source on GitHub ↗
(message: string, customArgs: any)

Source from the content-addressed store, hash-verified

6const getArgPath = (arg: string): string => arg.replace(/[{}]/g, '');
7
8const parseMessage = (message: string, customArgs: any): string => {
9 const parsableArgs = getArgsToParse(message);
10 return Array.isArray(parsableArgs)
11 ? parsableArgs.reduce(
12 (customMessage, arg) =>
13 customMessage.replace(arg, get(customArgs, getArgPath(arg), arg)),
14 message
15 )
16 : message;
17};
18
19export const parseMessageWithCustomArgs = (
20 message: string,

Callers 1

Calls 3

getFunction · 0.90
getArgsToParseFunction · 0.85
getArgPathFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…