mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Remove the isStream
helper function
At this point all the various Stream-classes extends an abstract base-class, hence this helper function is no longer necessary and only adds unnecessary indirection in the code.
This commit is contained in:
parent
d9a3a24353
commit
1a31855977
15 changed files with 51 additions and 80 deletions
|
@ -23,8 +23,8 @@ import {
|
|||
Util,
|
||||
warn,
|
||||
} from "../shared/util.js";
|
||||
import { BaseStream } from "./base_stream.js";
|
||||
import { ColorSpace } from "./colorspace.js";
|
||||
import { isStream } from "./primitives.js";
|
||||
import { MissingDataException } from "./core_utils.js";
|
||||
|
||||
const ShadingType = {
|
||||
|
@ -50,7 +50,7 @@ class Pattern {
|
|||
pdfFunctionFactory,
|
||||
localColorSpaceCache
|
||||
) {
|
||||
const dict = isStream(shading) ? shading.dict : shading;
|
||||
const dict = shading instanceof BaseStream ? shading.dict : shading;
|
||||
const type = dict.get("ShadingType");
|
||||
|
||||
try {
|
||||
|
@ -403,7 +403,7 @@ class MeshShading extends BaseShading {
|
|||
localColorSpaceCache
|
||||
) {
|
||||
super();
|
||||
if (!isStream(stream)) {
|
||||
if (!(stream instanceof BaseStream)) {
|
||||
throw new FormatError("Mesh data is not a stream");
|
||||
}
|
||||
const dict = stream.dict;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue