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:
parent
384bd96165
commit
20cbb89412
@ -502,9 +502,7 @@ class PDFFunction {
|
|||||||
|
|
||||||
function isPDFFunction(v) {
|
function isPDFFunction(v) {
|
||||||
let fnDict;
|
let fnDict;
|
||||||
if (typeof v !== "object") {
|
if (v instanceof Dict) {
|
||||||
return false;
|
|
||||||
} else if (v instanceof Dict) {
|
|
||||||
fnDict = v;
|
fnDict = v;
|
||||||
} else if (v instanceof BaseStream) {
|
} else if (v instanceof BaseStream) {
|
||||||
fnDict = v.dict;
|
fnDict = v.dict;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user