1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +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:
Jonas Jenwald 2022-02-17 13:45:42 +01:00
parent d9a3a24353
commit 1a31855977
15 changed files with 51 additions and 80 deletions

View file

@ -13,8 +13,9 @@
* limitations under the License.
*/
import { isDict, isStream } from "./primitives.js";
import { BaseStream } from "./base_stream.js";
import { DecodeStream } from "./decode_stream.js";
import { isDict } from "./primitives.js";
import { Jbig2Image } from "./jbig2.js";
import { shadow } from "../shared/util.js";
@ -51,7 +52,7 @@ class Jbig2Stream extends DecodeStream {
const chunks = [];
if (isDict(this.params)) {
const globalsStream = this.params.get("JBIG2Globals");
if (isStream(globalsStream)) {
if (globalsStream instanceof BaseStream) {
const globals = globalsStream.getBytes();
chunks.push({ data: globals, start: 0, end: globals.length });
}