/
githubmirror
/
pdf.js
Обзор
Документация
Войти
/
githubmirror
/
pdf.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/display/network_stream.js
31 строка
1 KB
Jonas Jenwald
Move the `NetworkStream` choice from `src/display/api.js` and into a separate file
24 мар 2026, 19:08
24 мар 2026, 19:08
a0102ab
Код
Авторство
О чём код?
/* Copyright 2026 Mozilla Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { isNodeJS } from "../shared/util.js"; import { isValidFetchUrl } from "./display_utils.js"; import { PDFFetchStream } from "./fetch_stream.js"; import { PDFNetworkStream } from "./network.js"; import { PDFNodeStream } from "./node_stream.js"; function getNetworkStream(url) { // eslint-disable-next-line no-nested-ternary return isValidFetchUrl(url) ? PDFFetchStream : typeof PDFJSDev !== "undefined" && PDFJSDev.test("GENERIC") && isNodeJS ? PDFNodeStream : PDFNetworkStream; } export { getNetworkStream };