Skip to content

Commit

Permalink
make node traverse method synchronous
Browse files Browse the repository at this point in the history
  • Loading branch information
dbushell committed Oct 4, 2024
1 parent edaee90 commit 24e5fd2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dbushell/hyperless",
"version": "0.15.0",
"version": "0.16.0",
"exports": {
".": "./mod.ts"
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dbushell/hyperless",
"version": "0.15.0",
"version": "0.16.0",
"repository": {
"type": "git",
"url": "git+https://github.com/dbushell/hyperless.git"
Expand Down
6 changes: 2 additions & 4 deletions src/html-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,9 @@ export class Node {
}

/** Traverse node tree */
async traverse(callback: (node: Node) => unknown): Promise<void> {
traverse(callback: (node: Node) => unknown): void {
for (const child of this.#children) {
if ((await Promise.resolve(callback(child))) !== false) {
await child.traverse(callback);
}
if (callback(child) !== false) child.traverse(callback);
}
}

Expand Down

0 comments on commit 24e5fd2

Please sign in to comment.