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:
parent
d9a3a24353
commit
1a31855977
15 changed files with 51 additions and 80 deletions
|
@ -14,9 +14,10 @@
|
|||
*/
|
||||
|
||||
import { bytesToString, escapeString, warn } from "../shared/util.js";
|
||||
import { Dict, isDict, isName, isRef, isStream, Name } from "./primitives.js";
|
||||
import { Dict, isDict, isName, isRef, Name } from "./primitives.js";
|
||||
import { escapePDFName, parseXFAPath } from "./core_utils.js";
|
||||
import { SimpleDOMNode, SimpleXMLParser } from "./xml_parser.js";
|
||||
import { BaseStream } from "./base_stream.js";
|
||||
import { calculateMD5 } from "./crypto.js";
|
||||
|
||||
function writeDict(dict, buffer, transform) {
|
||||
|
@ -87,7 +88,7 @@ function writeValue(value, buffer, transform) {
|
|||
buffer.push(value.toString());
|
||||
} else if (isDict(value)) {
|
||||
writeDict(value, buffer, transform);
|
||||
} else if (isStream(value)) {
|
||||
} else if (value instanceof BaseStream) {
|
||||
writeStream(value, buffer, transform);
|
||||
} else if (value === null) {
|
||||
buffer.push("null");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue