@magnetarjs/core
Advanced tools
Comparing version 0.6.1 to 0.6.2
@@ -803,9 +803,2 @@ "use strict"; | ||
const fetchPromises = (0, import_getorset_anything.mapGetOrSet)(fetchPromiseMap, pathFilterIdentifier, () => /* @__PURE__ */ new Map()); | ||
if (!closeStreamFnMap.has(pathFilterIdentifier)) { | ||
closeStreamFnMap.set(pathFilterIdentifier, () => { | ||
}); | ||
} | ||
if (!streamingPromiseMap.has(pathFilterIdentifier)) { | ||
streamingPromiseMap.set(pathFilterIdentifier, null); | ||
} | ||
function cacheStream(closeStreamFn, streamingPromise) { | ||
@@ -820,10 +813,16 @@ closeStreamFnMap.set(pathFilterIdentifier, closeStreamFn); | ||
const closeStreamFn = closeStreamFnMap.get(pathFilterIdentifier); | ||
if (closeStreamFn) | ||
if (closeStreamFn) { | ||
closeStreamFn(); | ||
setTimeout(() => { | ||
streamingPromiseMap.delete(pathFilterIdentifier); | ||
closeStreamFnMap.delete(pathFilterIdentifier); | ||
}); | ||
} | ||
} | ||
function closeAllStreams() { | ||
for (const [identifier, closeStreamFn] of closeStreamFnMap) { | ||
const _modulePath = identifier.split(MODULE_IDENTIFIER_SPLIT)[0]; | ||
if (_modulePath === modulePath) | ||
const openStreamPath = identifier.split(MODULE_IDENTIFIER_SPLIT)[0]; | ||
if (openStreamPath === modulePath || openStreamPath.startsWith(modulePath + "/")) { | ||
closeStreamFn(); | ||
} | ||
} | ||
@@ -830,0 +829,0 @@ } |
{ | ||
"name": "@magnetarjs/core", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"sideEffects": false, | ||
@@ -31,3 +31,3 @@ "description": "Magnetar core library.", | ||
"devDependencies": { | ||
"@magnetarjs/test-utils": "0.6.1" | ||
"@magnetarjs/test-utils": "0.6.2" | ||
}, | ||
@@ -76,3 +76,3 @@ "keywords": [ | ||
"scripts": { | ||
"build": "tsup src/index.ts --format esm,cjs --dts", | ||
"build": "tsup src/index.ts --clean --format esm,cjs --dts", | ||
"dev": "pnpm build --watch", | ||
@@ -79,0 +79,0 @@ "test-and-build": "npm run test && npm run build", |
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
2
108350
5
2657