mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
Remove the isRef
helper function
This helper function is not really needed, since it's just a wrapper around a simple `instanceof` check, and it only adds unnecessary indirection in the code.
This commit is contained in:
parent
df0aa1a9c4
commit
2cb2f633ac
10 changed files with 55 additions and 67 deletions
|
@ -13,11 +13,11 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { isRef, Ref } from "../../src/core/primitives.js";
|
||||
import { Page, PDFDocument } from "../../src/core/document.js";
|
||||
import { assert } from "../../src/shared/util.js";
|
||||
import { DocStats } from "../../src/core/core_utils.js";
|
||||
import { isNodeJS } from "../../src/shared/is_node.js";
|
||||
import { Ref } from "../../src/core/primitives.js";
|
||||
import { StringStream } from "../../src/core/stream.js";
|
||||
|
||||
const TEST_PDFS_PATH = isNodeJS ? "./test/pdfs/" : "../pdfs/";
|
||||
|
@ -106,10 +106,10 @@ class XRefMock {
|
|||
}
|
||||
|
||||
fetchIfRef(obj) {
|
||||
if (!isRef(obj)) {
|
||||
return obj;
|
||||
if (obj instanceof Ref) {
|
||||
return this.fetch(obj);
|
||||
}
|
||||
return this.fetch(obj);
|
||||
return obj;
|
||||
}
|
||||
|
||||
async fetchIfRefAsync(obj) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue