MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / preprocess

Function preprocess

packages/ast/preprocess/index.js:15–27  ·  view source on GitHub ↗
(message, allUsers)

Source from the content-addressed store, hash-verified

13}
14
15const preprocess = (message, allUsers) => {
16 const tree = parse.linen(message);
17 walk(tree, (node) => {
18 if (node.type === 'user' || node.type === 'signal') {
19 const user = allUsers.find((user) => user.id === node.id);
20 if (user) {
21 node.source = `${getTag(node.type)}${user.username}`;
22 node.id = user.username;
23 }
24 }
25 });
26 return stringify(tree);
27};
28
29module.exports = preprocess;

Callers 2

EditThreadModalFunction · 0.90
EditMessageModalFunction · 0.90

Calls 4

walkFunction · 0.85
stringifyFunction · 0.85
getTagFunction · 0.70
findMethod · 0.45

Tested by

no test coverage detected