charon-hooks 0.4.0 → 0.4.1
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/dist/server/index.js +4 -13
- package/package.json +1 -1
package/dist/server/index.js
CHANGED
|
@@ -511,27 +511,18 @@ function copyDefaultFile(src, dest) {
|
|
|
511
511
|
}
|
|
512
512
|
|
|
513
513
|
// src/lib/pipeline/sanitizer.ts
|
|
514
|
-
var sanitizerCache = /* @__PURE__ */ new Map();
|
|
515
514
|
var jiti = createJiti(import.meta.url);
|
|
516
515
|
async function loadSanitizer(name) {
|
|
517
|
-
if (sanitizerCache.has(name)) {
|
|
518
|
-
return sanitizerCache.get(name);
|
|
519
|
-
}
|
|
520
516
|
const sanitizerPath = resolve3(sanitizersDir, `${name}.ts`);
|
|
521
517
|
try {
|
|
522
|
-
const sanitizerUrl = pathToFileURL(sanitizerPath).href
|
|
518
|
+
const sanitizerUrl = pathToFileURL(sanitizerPath).href + `?t=${Date.now()}`;
|
|
523
519
|
const mod = await import(sanitizerUrl);
|
|
524
|
-
|
|
525
|
-
sanitizerCache.set(name, fn);
|
|
526
|
-
return fn;
|
|
520
|
+
return mod.default;
|
|
527
521
|
} catch {
|
|
528
522
|
try {
|
|
529
|
-
const mod = await jiti.import(sanitizerPath);
|
|
530
|
-
|
|
531
|
-
sanitizerCache.set(name, fn);
|
|
532
|
-
return fn;
|
|
523
|
+
const mod = await jiti.import(sanitizerPath, { cache: false });
|
|
524
|
+
return mod.default;
|
|
533
525
|
} catch {
|
|
534
|
-
sanitizerCache.set(name, null);
|
|
535
526
|
return null;
|
|
536
527
|
}
|
|
537
528
|
}
|