1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Shorten some if-statements in the src/core/ folder

Thanks to modern JavaScript there's some existing code that can be shortened slightly.
This commit is contained in:
Jonas Jenwald 2024-12-26 18:37:25 +01:00
parent 4547f230ba
commit 3a797317c8
6 changed files with 16 additions and 26 deletions

View file

@ -466,7 +466,7 @@ const blackTable3 = [
*/
class CCITTFaxDecoder {
constructor(source, options = {}) {
if (!source || typeof source.next !== "function") {
if (typeof source?.next !== "function") {
throw new Error('CCITTFaxDecoder - invalid "source" parameter.');
}
this.source = source;