Skip to content

Commit b4da17e

Browse files
Eugene Crystalhleb-albau
authored andcommitted
Add decodedLog method to Response
1 parent 5a81525 commit b4da17e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/ext/process-response.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import {
1010
} from "../models/index.js";
1111
import {Text} from "./text.js";
1212
import {Images} from "./images.js";
13+
// @ts-ignore
14+
import converter from "base64-arraybuffer";
1315

1416

1517
export class Response {
@@ -38,6 +40,11 @@ export class Response {
3840
this.images = new Images(imagesResult.Images)
3941
}
4042
}
43+
44+
public decodedLog(): string | undefined {
45+
const log = this.lowLvlResponse.log
46+
return log ? String.fromCharCode.apply(null, new Uint8Array(converter.decode(log))) : undefined;
47+
}
4148
}
4249

4350
export class LowLvlResponse implements ProcessResponse {

0 commit comments

Comments
 (0)