Skip to content

Commit

Permalink
fix(index): promise resolve type for pdfInfo()
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed Sep 17, 2023
1 parent c725ff9 commit 85c4c36
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,8 @@ class Poppler {
* such as Link Annotations are listed, not URL strings in the text content.
* @param {boolean} [options.printVersionInfo] - Print copyright and version info.
* @param {string} [options.userPassword] - User password (for encrypted files).
* @returns {Promise<string>} A promise that resolves with a stdout string, or rejects with an `Error` object.
* @returns {Promise<object|string>} A promise that resolves with a stdout string or JSON object if
* `options.printAsJson` is `true`, or rejects with an `Error` object.
*/
async pdfInfo(file, options = {}) {
const acceptedOptions = {
Expand Down Expand Up @@ -487,6 +488,7 @@ class Poppler {
stdOut.split("\n").forEach((line) => {
const lines = line.split(": ");
if (lines.length > 1) {
// @ts-ignore: creating dynamic object keys
info[camelCase(lines[0])] = lines[1].trim();
}
});
Expand Down

0 comments on commit 85c4c36

Please sign in to comment.