Skip to content

Commit

Permalink
fix: graph parser.parse missing return type (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
sun0day committed Dec 22, 2023
1 parent 798fe29 commit b7fba89
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions packages/graph/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,12 @@ export class Parser {
this.parser.visit(Buffer.from(fileArr.toString()), depth, resolve)
}

parse() {
const parsed = this.parser.parse()
return JSON.parse(parsed.toString())
parse(): Record<string, ImportNode> {
return JSON.parse(this.buffer().toString())
}

buffer() {
return this.parser.parse()
}
}

2 changes: 1 addition & 1 deletion packages/graph/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "easy-ast.graph",
"version": "0.0.0-beta.1",
"version": "0.0.0-beta.2",
"main": "index.js",
"types": "index.d.ts",
"description": "Fast APIs for js/ts module graph.",
Expand Down

0 comments on commit b7fba89

Please sign in to comment.