-
Notifications
You must be signed in to change notification settings - Fork 468
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add function to ignore punycode warnings * 1.0.39 * Also increase max tokens
- Loading branch information
1 parent
55d209f
commit 581756b
Showing
3 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Tesseract relies on node-fetch v2, which has a deprecated version of punycode | ||
// Suppress the warning for now. Check in when teseract updates to node-fetch v3 | ||
// https://github.com/naptha/tesseract.js/issues/876 | ||
if (process.stderr.write === process.stderr.constructor.prototype.write) { | ||
const stdErrWrite = process.stderr.write; | ||
process.stderr.write = function (chunk: any, ...args: any[]) { | ||
const str = Buffer.isBuffer(chunk) ? chunk.toString() : chunk; | ||
|
||
// Filter out the punycode deprecation warning | ||
if (str.includes("punycode")) { | ||
return true; | ||
} | ||
return stdErrWrite.apply(process.stderr, [chunk]); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import "./handleWarnings"; | ||
import { | ||
addWorkersToTesseractScheduler, | ||
cleanupImage, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters