webtorrent
Advanced tools
Comparing version 2.4.15 to 2.5.0
@@ -13,3 +13,3 @@ import EventEmitter from 'events' | ||
import Discovery from 'torrent-discovery' | ||
import FSChunkStore from 'fs-chunk-store' // browser: `hybrid-chunk-store` | ||
import FSChunkStore from 'fs-chunk-store' // browser: `fsa-chunk-store` | ||
import fetch from 'cross-fetch-ponyfill' | ||
@@ -19,3 +19,2 @@ import ImmediateChunkStore from 'immediate-chunk-store' | ||
import MemoryChunkStore from 'memory-chunk-store' | ||
import HybridChunkStore from 'hybrid-chunk-store' | ||
import joinIterator from 'join-async-iterator' | ||
@@ -63,2 +62,8 @@ import parallel from 'run-parallel' | ||
// if nodejs or browser that supports FSA | ||
const SUPPORTS_FSA = globalThis.navigator?.storage?.getDirectory && globalThis.FileSystemFileHandle?.prototype?.createWritable | ||
const FALLBACK_STORE = !process.browser || SUPPORTS_FSA | ||
? FSChunkStore // Node or browser with FSA | ||
: MemoryChunkStore | ||
let TMP | ||
@@ -87,3 +92,3 @@ try { | ||
this.skipVerify = !!opts.skipVerify | ||
this._store = opts.store || FSChunkStore | ||
this._store = opts.store || FALLBACK_STORE | ||
this._preloadedStore = opts.preloadedStore || null | ||
@@ -545,3 +550,3 @@ this._storeCacheSlots = opts.storeCacheSlots !== undefined ? opts.storeCacheSlots : 20 | ||
// don't use the cache if the store is already in memory | ||
if (this._storeCacheSlots > 0 && !(rawStore instanceof MemoryChunkStore || rawStore instanceof HybridChunkStore)) { | ||
if (this._storeCacheSlots > 0 && !(rawStore instanceof MemoryChunkStore)) { | ||
rawStore = new CacheChunkStore(rawStore, { | ||
@@ -548,0 +553,0 @@ max: this._storeCacheSlots |
{ | ||
"name": "webtorrent", | ||
"description": "Streaming torrent client", | ||
"version": "2.4.15", | ||
"version": "2.5.0", | ||
"author": { | ||
@@ -18,3 +18,3 @@ "name": "WebTorrent LLC", | ||
"fs": false, | ||
"fs-chunk-store": "hybrid-chunk-store", | ||
"fs-chunk-store": "fsa-chunk-store", | ||
"http": false, | ||
@@ -56,3 +56,3 @@ "load-ip-set": false, | ||
"fs-chunk-store": "^4.1.0", | ||
"hybrid-chunk-store": "^1.2.6", | ||
"fsa-chunk-store": "^1.3.0", | ||
"immediate-chunk-store": "^2.2.0", | ||
@@ -59,0 +59,0 @@ "join-async-iterator": "^1.1.1", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5838313
8432
+ Addedfsa-chunk-store@^1.3.0
- Removedhybrid-chunk-store@^1.2.6
- Removed@thaunknown/idb-chunk-store@1.0.4(transitive)
- Removedhybrid-chunk-store@1.2.6(transitive)
- Removedidb@7.1.1(transitive)