Improve join/leave, publish messages

This commit is contained in:
Jon Staab
2024-08-23 13:33:36 -07:00
parent d6fa0a85bc
commit f12e7ef77c
24 changed files with 412 additions and 297 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ export const createPasteRuleMatch = <T extends Record<string, unknown>>(
data: T,
): PasteRuleMatch => ({ index: match.index!, replaceWith: match[2], text: match[0], match, data })
export const findNodes = (json: JSONContent, type: string) => {
export const findNodes = (type: string, json: JSONContent) => {
const results: JSONContent[] = []
for (const node of json.content || []) {
@@ -13,7 +13,7 @@ export const findNodes = (json: JSONContent, type: string) => {
results.push(node)
}
for (const result of findNodes(node, type)) {
for (const result of findNodes(type, node)) {
results.push(result)
}
}