ol 10.1.1-dev.1726164767265 → 10.1.1-dev.1726174617540
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ImageTile.d.ts.map +1 -1
- package/ImageTile.js +9 -0
- package/Tile.d.ts.map +1 -1
- package/Tile.js +8 -0
- package/VectorRenderTile.d.ts +8 -3
- package/VectorRenderTile.d.ts.map +1 -1
- package/VectorRenderTile.js +22 -6
- package/VectorTile.d.ts +4 -0
- package/VectorTile.d.ts.map +1 -1
- package/VectorTile.js +7 -0
- package/dist/ol.js +1 -1
- package/dist/ol.js.map +1 -1
- package/package.json +1 -1
- package/renderer/canvas/TileLayer.d.ts.map +1 -1
- package/renderer/canvas/TileLayer.js +0 -1
- package/source/VectorTile.d.ts +15 -5
- package/source/VectorTile.d.ts.map +1 -1
- package/source/VectorTile.js +47 -47
- package/structs/LRUCache.d.ts +2 -1
- package/structs/LRUCache.d.ts.map +1 -1
- package/structs/LRUCache.js +7 -2
- package/util.js +1 -1
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileLayer.d.ts","sourceRoot":"","sources":["TileLayer.js"],"names":[],"mappings":";yBAyCa;QAAO,MAAM,GAAE,GAAG,CAAC,OAAO,eAAe,EAAE,OAAO,CAAC;CAAC;;;;;;;AAiEjE;;;GAGG;AAEH;;;;;;GAMG;AACH,sCAHkG,SAAS,SAA7F,OAAO,qBAAqB,EAAE,OAAO,GAAC,OAAO,2BAA2B,EAAE,OAAQ;IAI9F;;;OAGG;IACH,uBAHW,SAAS,iCA+FnB;IAvFC;;;OAGG;IACH,eAFU,OAAO,CAEQ;IAEzB;;;OAGG;IACH,gBAFU,OAAO,CAEU;IAE3B;;;OAGG;IACH,wBAA2B;IAE3B;;;OAGG;IACH,8BAFU,MAAM,CAEO;IAEvB;;;OAGG;IACH,8BAFU,OAAO,0BAA0B,EAAE,OAAO,CAEtB;IAE9B;;;OAGG;IACH,4BA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AED;;;;;;;;;;;;;OAaG;IACH,iCALW,OAAO,cAAc,EAAE,UAAU,UACjC,WAAW,GACV,WAAW,CAiUtB;IAED;;;OAGG;IACH,2BAFW,MAAM,QAOhB;IAED;;;;;;;;;;OAUG;IACH,yBAVW,OAAO,eAAe,EAAE,OAAO,cAC/B,OAAO,cAAc,EAAE,UAAU,KACjC,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,UACN,MAAM,cACN,OAAO,QAiDjB;IAED;;OAEG;IACH,YAFY,iBAAiB,CAK5B;IAED;;;;;OAKG;IACH,6BAJW,OAAO,oBAAoB,EAAE,OAAO,GACnC,iBAAiB,GAAC,gBAAgB,GAAC,gBAAgB,CAK9D;IAED;;;;;OAKG;IACH,qCALW;YAAQ,MAAM,GAAE;gBAAQ,MAAM,GAAE,OAAO;SAAC;KAAC,cACzC,OAAO,sBAAsB,EAAE,OAAO,QACtC,OAAO,eAAe,EAAE,OAAO,QAUzC;CACF;gCAx8B+B,YAAY;qBAGvB,2BAA2B"}
|
|
@@ -848,7 +848,6 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
|
|
|
848
848
|
}
|
|
849
849
|
context.imageSmoothingEnabled = true;
|
|
850
850
|
|
|
851
|
-
// TODO: let the renderers manage their own cache instead of managing the source cache
|
|
852
851
|
/**
|
|
853
852
|
* Here we unconditionally expire the source cache since the renderer maintains
|
|
854
853
|
* its own cache.
|
package/source/VectorTile.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export type Options<FeatureType extends import("../Feature.js").FeatureLike = im
|
|
|
43
43
|
*/
|
|
44
44
|
state?: import("./Source.js").State | undefined;
|
|
45
45
|
/**
|
|
46
|
-
* Class used to instantiate
|
|
46
|
+
* Class used to instantiate tiles.
|
|
47
47
|
* Default is {@link module :ol/VectorTile~VectorTile}.
|
|
48
48
|
*/
|
|
49
49
|
tileClass?: typeof Tile | undefined;
|
|
@@ -144,7 +144,7 @@ export type Options<FeatureType extends import("../Feature.js").FeatureLike = im
|
|
|
144
144
|
* stroke operations.
|
|
145
145
|
* @property {import("../proj.js").ProjectionLike} [projection='EPSG:3857'] Projection of the tile grid.
|
|
146
146
|
* @property {import("./Source.js").State} [state] Source state.
|
|
147
|
-
* @property {typeof import("../VectorTile.js").default} [tileClass] Class used to instantiate
|
|
147
|
+
* @property {typeof import("../VectorTile.js").default} [tileClass] Class used to instantiate tiles.
|
|
148
148
|
* Default is {@link module:ol/VectorTile~VectorTile}.
|
|
149
149
|
* @property {number} [maxZoom=22] Optional max zoom level. Not used if `tileGrid` is provided.
|
|
150
150
|
* @property {number} [minZoom] Optional min zoom level. Not used if `tileGrid` is provided.
|
|
@@ -220,10 +220,16 @@ declare class VectorTile<FeatureType extends import("../Feature.js").FeatureLike
|
|
|
220
220
|
*/
|
|
221
221
|
private format_;
|
|
222
222
|
/**
|
|
223
|
+
* @type {Object<string, Array<string>>}
|
|
223
224
|
* @private
|
|
224
|
-
* @type {TileCache}
|
|
225
225
|
*/
|
|
226
|
-
private
|
|
226
|
+
private tileKeysBySourceTileUrl_;
|
|
227
|
+
/**
|
|
228
|
+
@type {Object<string, Tile<FeatureType>>}
|
|
229
|
+
*/
|
|
230
|
+
sourceTiles_: {
|
|
231
|
+
[x: string]: Tile<FeatureType>;
|
|
232
|
+
};
|
|
227
233
|
/**
|
|
228
234
|
* @private
|
|
229
235
|
* @type {boolean}
|
|
@@ -246,10 +252,14 @@ declare class VectorTile<FeatureType extends import("../Feature.js").FeatureLike
|
|
|
246
252
|
/**
|
|
247
253
|
* @param {number} pixelRatio Pixel ratio.
|
|
248
254
|
* @param {import("../proj/Projection").default} projection Projection.
|
|
249
|
-
* @param {VectorRenderTile} tile Vector
|
|
255
|
+
* @param {VectorRenderTile} tile Vector render tile.
|
|
250
256
|
* @return {Array<import("../VectorTile").default>} Tile keys.
|
|
251
257
|
*/
|
|
252
258
|
getSourceTiles(pixelRatio: number, projection: import("../proj/Projection").default, tile: VectorRenderTile): Array<Tile<any>>;
|
|
259
|
+
/**
|
|
260
|
+
* @param {VectorRenderTile} tile Vector render tile.
|
|
261
|
+
*/
|
|
262
|
+
removeSourceTiles(tile: VectorRenderTile): void;
|
|
253
263
|
/**
|
|
254
264
|
* @param {number} z Tile coordinate z.
|
|
255
265
|
* @param {number} x Tile coordinate x.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorTile.d.ts","sourceRoot":"","sources":["VectorTile.js"],"names":[],"mappings":"AAsaA;;;;;GAKG;AACH,oCAJoD,WAAW,SAAlD,OAAQ,eAAe,EAAE,WAAY,iDACvC,OAAO,kBAAkB,EAAE,OAAO,CAAC,WAAW,CAAC,OAC/C,MAAM,QAqBhB;;
|
|
1
|
+
{"version":3,"file":"VectorTile.d.ts","sourceRoot":"","sources":["VectorTile.js"],"names":[],"mappings":"AAsaA;;;;;GAKG;AACH,oCAJoD,WAAW,SAAlD,OAAQ,eAAe,EAAE,WAAY,iDACvC,OAAO,kBAAkB,EAAE,OAAO,CAAC,WAAW,CAAC,OAC/C,MAAM,QAqBhB;;oBAzamD,WAAW,SAAlD,OAAQ,eAAe,EAAE,WAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAWpC,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAZjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AAEH;;;;;;;;;;;;;GAaG;AACH,yBAFoD,WAAW,SAAlD,OAAQ,eAAe,EAAE,WAAY;IAGhD;;OAEG;IACH,qBAFY,OAAO,CAAC,WAAW,CAAC,EAsE/B;IAlCC;;;OAGG;IACH,gBAAqD;IAErD;;;OAGG;IACH,iCAAkC;IAElC;;OAEG;IACH,cAFQ;YAAO,MAAM,GAAE,IAAI,CAAC,WAAW,CAAC;KAAC,CAEnB;IAEtB;;;OAGG;IACH,kBAAwE;IAExE;;;OAGG;IACH,qBAFU,WAAyC,CAEU;IAE7D;;;OAGG;IACH,mBAAoB;IAGtB;;OAEG;IACH,eAFY,OAAO,CAIlB;IAED;;;;;OAKG;IACH,2BALW,MAAM,cACN,OAAO,oBAAoB,EAAE,OAAO,QACpC,gBAAgB,GACf,KAAK,CAAC,SAA+B,CAAC,CAgGjD;IAED;;OAEG;IACH,wBAFW,gBAAgB,QAoB1B;IAED;;;;;;;;OAQG;IACH,oBARW,MAAM,KACN,MAAM,KACN,MAAM,cACN,MAAM,cACN,OAAO,uBAAuB,EAAE,OAAO,GACrC,gBAAgB,CA0C5B;CA+DF;iBA7ZgB,kBAAkB;qBACd,yBAAyB;oBAE1B,cAAc;6BACL,wBAAwB"}
|
package/source/VectorTile.js
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import EventType from '../events/EventType.js';
|
|
6
6
|
import Tile from '../VectorTile.js';
|
|
7
|
-
import TileCache from '../TileCache.js';
|
|
8
7
|
import TileGrid from '../tilegrid/TileGrid.js';
|
|
9
8
|
import TileState from '../TileState.js';
|
|
10
9
|
import UrlTile from './UrlTile.js';
|
|
@@ -16,7 +15,6 @@ import {
|
|
|
16
15
|
intersects,
|
|
17
16
|
} from '../extent.js';
|
|
18
17
|
import {createXYZ, extentFromProjection} from '../tilegrid.js';
|
|
19
|
-
import {getCacheKeyForTileKey} from '../tilecoord.js';
|
|
20
18
|
import {isEmpty} from '../obj.js';
|
|
21
19
|
import {loadFeaturesXhr} from '../featureloader.js';
|
|
22
20
|
import {toSize} from '../size.js';
|
|
@@ -35,7 +33,7 @@ import {toSize} from '../size.js';
|
|
|
35
33
|
* stroke operations.
|
|
36
34
|
* @property {import("../proj.js").ProjectionLike} [projection='EPSG:3857'] Projection of the tile grid.
|
|
37
35
|
* @property {import("./Source.js").State} [state] Source state.
|
|
38
|
-
* @property {typeof import("../VectorTile.js").default} [tileClass] Class used to instantiate
|
|
36
|
+
* @property {typeof import("../VectorTile.js").default} [tileClass] Class used to instantiate tiles.
|
|
39
37
|
* Default is {@link module:ol/VectorTile~VectorTile}.
|
|
40
38
|
* @property {number} [maxZoom=22] Optional max zoom level. Not used if `tileGrid` is provided.
|
|
41
39
|
* @property {number} [minZoom] Optional min zoom level. Not used if `tileGrid` is provided.
|
|
@@ -146,10 +144,15 @@ class VectorTile extends UrlTile {
|
|
|
146
144
|
this.format_ = options.format ? options.format : null;
|
|
147
145
|
|
|
148
146
|
/**
|
|
147
|
+
* @type {Object<string, Array<string>>}
|
|
149
148
|
* @private
|
|
150
|
-
* @type {TileCache}
|
|
151
149
|
*/
|
|
152
|
-
this.
|
|
150
|
+
this.tileKeysBySourceTileUrl_ = {};
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
@type {Object<string, Tile<FeatureType>>}
|
|
154
|
+
*/
|
|
155
|
+
this.sourceTiles_ = {};
|
|
153
156
|
|
|
154
157
|
/**
|
|
155
158
|
* @private
|
|
@@ -177,41 +180,10 @@ class VectorTile extends UrlTile {
|
|
|
177
180
|
return this.overlaps_;
|
|
178
181
|
}
|
|
179
182
|
|
|
180
|
-
/**
|
|
181
|
-
* clear {@link module:ol/TileCache~TileCache} and delete all source tiles
|
|
182
|
-
* @api
|
|
183
|
-
* @override
|
|
184
|
-
*/
|
|
185
|
-
clear() {
|
|
186
|
-
this.sourceTileCache_.clear();
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* @param {import("../proj/Projection.js").default} projection Projection.
|
|
191
|
-
* @param {!Object<string, boolean>} usedTiles Used tiles.
|
|
192
|
-
* @override
|
|
193
|
-
*/
|
|
194
|
-
expireCache(projection, usedTiles) {
|
|
195
|
-
const tileCache = this.getTileCacheForProjection(projection);
|
|
196
|
-
const usedSourceTiles = Object.keys(usedTiles).reduce((acc, key) => {
|
|
197
|
-
const cacheKey = getCacheKeyForTileKey(key);
|
|
198
|
-
const tile = tileCache.peek(cacheKey);
|
|
199
|
-
if (tile) {
|
|
200
|
-
const sourceTiles = tile.sourceTiles;
|
|
201
|
-
for (let i = 0, ii = sourceTiles.length; i < ii; ++i) {
|
|
202
|
-
acc[sourceTiles[i].getKey()] = true;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
return acc;
|
|
206
|
-
}, {});
|
|
207
|
-
super.expireCache(projection, usedTiles);
|
|
208
|
-
this.sourceTileCache_.expireCache(usedSourceTiles);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
183
|
/**
|
|
212
184
|
* @param {number} pixelRatio Pixel ratio.
|
|
213
185
|
* @param {import("../proj/Projection").default} projection Projection.
|
|
214
|
-
* @param {VectorRenderTile} tile Vector
|
|
186
|
+
* @param {VectorRenderTile} tile Vector render tile.
|
|
215
187
|
* @return {Array<import("../VectorTile").default>} Tile keys.
|
|
216
188
|
*/
|
|
217
189
|
getSourceTiles(pixelRatio, projection, tile) {
|
|
@@ -240,16 +212,21 @@ class VectorTile extends UrlTile {
|
|
|
240
212
|
pixelRatio,
|
|
241
213
|
projection,
|
|
242
214
|
);
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
215
|
+
if (!this.sourceTiles_[tileUrl]) {
|
|
216
|
+
this.sourceTiles_[tileUrl] = new this.tileClass(
|
|
217
|
+
sourceTileCoord,
|
|
218
|
+
tileUrl ? TileState.IDLE : TileState.EMPTY,
|
|
219
|
+
tileUrl,
|
|
220
|
+
this.format_,
|
|
221
|
+
this.tileLoadFunction,
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
const sourceTile = this.sourceTiles_[tileUrl];
|
|
252
225
|
tile.sourceTiles.push(sourceTile);
|
|
226
|
+
if (!this.tileKeysBySourceTileUrl_[tileUrl]) {
|
|
227
|
+
this.tileKeysBySourceTileUrl_[tileUrl] = [];
|
|
228
|
+
}
|
|
229
|
+
this.tileKeysBySourceTileUrl_[tileUrl].push(tile.getKey());
|
|
253
230
|
const sourceTileState = sourceTile.getState();
|
|
254
231
|
if (sourceTileState < TileState.LOADED) {
|
|
255
232
|
const listenChange = (event) => {
|
|
@@ -288,7 +265,6 @@ class VectorTile extends UrlTile {
|
|
|
288
265
|
sourceTile.resolution = sourceTileGrid.getResolution(
|
|
289
266
|
sourceTileCoord[0],
|
|
290
267
|
);
|
|
291
|
-
this.sourceTileCache_.set(tileUrl, sourceTile);
|
|
292
268
|
sourceTile.load();
|
|
293
269
|
}
|
|
294
270
|
});
|
|
@@ -306,6 +282,29 @@ class VectorTile extends UrlTile {
|
|
|
306
282
|
return tile.sourceTiles;
|
|
307
283
|
}
|
|
308
284
|
|
|
285
|
+
/**
|
|
286
|
+
* @param {VectorRenderTile} tile Vector render tile.
|
|
287
|
+
*/
|
|
288
|
+
removeSourceTiles(tile) {
|
|
289
|
+
const sourceTiles = tile.sourceTiles;
|
|
290
|
+
for (let i = 0, ii = sourceTiles.length; i < ii; ++i) {
|
|
291
|
+
const sourceTileUrl = sourceTiles[i].getTileUrl();
|
|
292
|
+
const tileKey = this.getKey();
|
|
293
|
+
if (!this.tileKeysBySourceTileUrl_[sourceTileUrl]) {
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
const index = this.tileKeysBySourceTileUrl_[sourceTileUrl][tileKey];
|
|
297
|
+
if (index === -1) {
|
|
298
|
+
continue;
|
|
299
|
+
}
|
|
300
|
+
this.tileKeysBySourceTileUrl_[sourceTileUrl].splice(index, 1);
|
|
301
|
+
if (this.tileKeysBySourceTileUrl_[sourceTileUrl].length === 0) {
|
|
302
|
+
delete this.tileKeysBySourceTileUrl_[sourceTileUrl];
|
|
303
|
+
delete this.sourceTiles_[sourceTileUrl];
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
309
308
|
/**
|
|
310
309
|
* @param {number} z Tile coordinate z.
|
|
311
310
|
* @param {number} x Tile coordinate x.
|
|
@@ -350,6 +349,7 @@ class VectorTile extends UrlTile {
|
|
|
350
349
|
empty ? TileState.EMPTY : TileState.IDLE,
|
|
351
350
|
urlTileCoord,
|
|
352
351
|
this.getSourceTiles.bind(this, pixelRatio, projection),
|
|
352
|
+
this.removeSourceTiles.bind(this),
|
|
353
353
|
);
|
|
354
354
|
newTile.key = this.getKey();
|
|
355
355
|
return newTile;
|
package/structs/LRUCache.d.ts
CHANGED
|
@@ -69,7 +69,8 @@ declare class LRUCache<T> {
|
|
|
69
69
|
*/
|
|
70
70
|
canExpireCache(): boolean;
|
|
71
71
|
/**
|
|
72
|
-
* Expire the cache.
|
|
72
|
+
* Expire the cache. When the cache entry is a {@link module:ol/Disposable~Disposable},
|
|
73
|
+
* the entry will be disposed.
|
|
73
74
|
* @param {!Object<string, boolean>} [keep] Keys to keep. To be implemented by subclasses.
|
|
74
75
|
*/
|
|
75
76
|
expireCache(keep?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LRUCache.d.ts","sourceRoot":"","sources":["LRUCache.js"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"LRUCache.d.ts","sourceRoot":"","sources":["LRUCache.js"],"names":[],"mappings":";;;;;UASc,MAAM;;;;WACN,KAAK,GAAC,IAAI;;;;WACV,KAAK,GAAC,IAAI;;;;YACV,GAAC;;AALf;;;;;;GAMG;AAEH;;;;;;;;GAQG;AACH,uBAFa,CAAC;IAGZ;;OAEG;IACH,gDA+BC;IA9BC;;;;OAIG;IACH,eAFU,MAAM,CAEuD;IAEvE;;;OAGG;IACH,eAAe;IAEf;;;OAGG;IACH,iBAAkB;IAElB;;;OAGG;IACH,gBAAmB;IAEnB;;;OAGG;IACH,gBAAmB;IAGrB;;OAEG;IACH,kBAFY,OAAO,CAIlB;IAED;;;;OAIG;IACH;;yBAOC;IAED;;OAEG;IACH,cAKC;IAED;;;OAGG;IACH,iBAHW,MAAM,GACL,OAAO,CAIlB;IAED;;;;;OAKG;IACH,WALW,CAAS,IAAC,EAAD,CAAC,EAAE,IAAM,EAAN,MAAM,EAAE,IAAW,EAAX,QAAQ,CAAC,CAAC,CAAC,KAAG,OAAC,QAW7C;IAED;;;;OAIG;IACH,SAJW,MAAM,YACN,GAAC,GACA,CAAC,CAuBZ;IAED;;;;OAIG;IACH,YAHW,MAAM,GACL,CAAC,CAyBZ;IAED;;OAEG;IACH,YAFY,MAAM,CAIjB;IAED;;OAEG;IACH,WAFY,KAAK,CAAC,MAAM,CAAC,CAUxB;IAED;;OAEG;IACH,aAFY,KAAK,CAAC,CAAC,CAAC,CAUnB;IAED;;OAEG;IACH,YAFY,CAAC,CAIZ;IAED;;OAEG;IACH,eAFY,MAAM,CAIjB;IAED;;;OAGG;IACH,gBAFY,MAAM,CAIjB;IAED;;;;OAIG;IACH,UAHW,MAAM,GACL,CAAC,GAAC,SAAS,CAItB;IAED;;OAEG;IACH,OAFY,CAAC,CAcZ;IAED;;;OAGG;IACH,aAHW,MAAM,SACN,CAAC,QAKX;IAED;;;OAGG;IACH,SAHW,MAAM,SACN,CAAC,QAqBX;IAED;;;;OAIG;IACH,cAHW,MAAM,QAKhB;CACF"}
|
package/structs/LRUCache.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* @module ol/structs/LRUCache
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import Disposable from '../Disposable.js';
|
|
5
6
|
import {assert} from '../asserts.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -66,12 +67,16 @@ class LRUCache {
|
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
/**
|
|
69
|
-
* Expire the cache.
|
|
70
|
+
* Expire the cache. When the cache entry is a {@link module:ol/Disposable~Disposable},
|
|
71
|
+
* the entry will be disposed.
|
|
70
72
|
* @param {!Object<string, boolean>} [keep] Keys to keep. To be implemented by subclasses.
|
|
71
73
|
*/
|
|
72
74
|
expireCache(keep) {
|
|
73
75
|
while (this.canExpireCache()) {
|
|
74
|
-
this.pop();
|
|
76
|
+
const entry = this.pop();
|
|
77
|
+
if (entry instanceof Disposable) {
|
|
78
|
+
entry.dispose();
|
|
79
|
+
}
|
|
75
80
|
}
|
|
76
81
|
}
|
|
77
82
|
|
package/util.js
CHANGED