Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async initialize(extensionPoint: ExtensionPoint): Promise {
const { bagPath, cacheSizeInBytes } = this._options;
await decompress.isLoaded;
if (bagPath.type === "remoteBagUrl") {
extensionPoint.progressCallback({ fullyLoadedFractionRanges: [] });
let approximateSize = 0;
const fileReader = new BrowserHttpReader(bagPath.url);
const remoteReader = new CachedFilelike({
fileReader,
cacheSizeInBytes: cacheSizeInBytes || 1024 * 1024 * 200, // 200MiB
logFn: (message) => {
log.info(`CachedFilelike: ${message}`);
},
keepReconnectingCallback: (reconnecting: boolean) => {
extensionPoint.reportMetadataCallback({
type: "updateReconnecting",
reconnecting,
});
initialize = async (initialize: InitializeMessage): Promise => {
await decompress.isLoaded;
this._bag = await open(initialize.bagPath);
};