Skip to content

Commit 2c37af0

Browse files
committed
refactor: add json to walk function names
Signed-off-by: Christian Stewart <christian@aperture.us>
1 parent a731cb7 commit 2c37af0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/model/walk.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ export type ModelVisitor = (node: JsonNode, parent: JsonNode | null) => boolean
99
* @param id The ID to find
1010
* @returns The found node or undefined if not found
1111
*/
12-
export function findNodeById(model: IJsonModel, id: string): JsonNode | undefined {
12+
export function findJsonNodeById(model: IJsonModel, id: string): JsonNode | undefined {
1313
let result: JsonNode | undefined;
1414

15-
walkModel(model, (node) => {
15+
walkJsonModel(model, (node) => {
1616
if ("id" in node && node.id === id) {
1717
result = node;
1818
return false; // stop walking
@@ -30,7 +30,7 @@ export function findNodeById(model: IJsonModel, id: string): JsonNode | undefine
3030
* @param visitor Callback called for each node in the tree. Return false to stop the traversal.
3131
* The visitor receives the current node and its parent (null for top-level nodes).
3232
*/
33-
export function walkModel(model: IJsonModel, visitor: ModelVisitor): void {
33+
export function walkJsonModel(model: IJsonModel, visitor: ModelVisitor): void {
3434
// Stack of nodes to visit and their parents
3535
const stack: Array<[IJsonBorderNode | IJsonRowNode | IJsonTabSetNode | IJsonTabNode, IJsonBorderNode | IJsonRowNode | IJsonTabSetNode | null]> = [];
3636

0 commit comments

Comments
 (0)