From b7fba894bc6a9723269e0d7f26558170562cbb0d Mon Sep 17 00:00:00 2001 From: sun0day Date: Fri, 22 Dec 2023 16:22:14 +0800 Subject: [PATCH] fix: graph parser.parse missing return type (#5) --- packages/graph/index.ts | 9 ++++++--- packages/graph/package.json | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/graph/index.ts b/packages/graph/index.ts index 85ec92e..06a5433 100644 --- a/packages/graph/index.ts +++ b/packages/graph/index.ts @@ -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 { + return JSON.parse(this.buffer().toString()) + } + + buffer() { + return this.parser.parse() } } diff --git a/packages/graph/package.json b/packages/graph/package.json index 9b59cbd..2ed10cd 100644 --- a/packages/graph/package.json +++ b/packages/graph/package.json @@ -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.",