mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 09:38: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
|
@ -13,8 +13,9 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { isDict, isStream } from "./primitives.js";
|
||||
import { stringToPDFString, warn } from "../shared/util.js";
|
||||
import { BaseStream } from "./base_stream.js";
|
||||
import { isDict } from "./primitives.js";
|
||||
|
||||
function pickPlatformItem(dict) {
|
||||
// Look for the filename in this order:
|
||||
|
@ -84,7 +85,7 @@ class FileSpec {
|
|||
let content = null;
|
||||
if (this.contentRef) {
|
||||
const fileObj = this.xref.fetchIfRef(this.contentRef);
|
||||
if (fileObj && isStream(fileObj)) {
|
||||
if (fileObj instanceof BaseStream) {
|
||||
content = fileObj.getBytes();
|
||||
} else {
|
||||
warn(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue