mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 18:25:37 +02:00
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
1 changed files with 1 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue