From 2b87c2e4a31f80c467af1c5db0e9da3a6e1e508d Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 28 May 2023 11:44:46 +0100 Subject: Introduce readAsText() on Image --- lib/documents.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/documents.js') diff --git a/lib/documents.js b/lib/documents.js index 67e98af..26c0ce7 100644 --- a/lib/documents.js +++ b/lib/documents.js @@ -152,6 +152,12 @@ function Image(options) { return { type: types.image, read: options.readImage, + readAsText: function(encoding) { + if (!encoding) { + throw new Error("Missing encoding argument"); + } + return options.readImage(encoding); + }, altText: options.altText, contentType: options.contentType }; -- cgit v1.2.3