Simplify the isPDFFunction helper function

Originally we used helper functions for checking if something was a Dictionary or Stream, and then having an initial `typeof` check probably made sense.
However, given that we're using `instanceof` nowadays the additional check longer seems necessary.
This commit is contained in:
Jonas Jenwald 2023-03-27 11:34:20 +02:00
parent 384bd96165
commit 20cbb89412

View File

@ -502,9 +502,7 @@ class PDFFunction {
function isPDFFunction(v) {
let fnDict;
if (typeof v !== "object") {
return false;
} else if (v instanceof Dict) {
if (v instanceof Dict) {
fnDict = v;
} else if (v instanceof BaseStream) {
fnDict = v.dict;