token-goat 2.6.28 → 2.6.30

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.
@@ -0,0 +1,33 @@
1
+ import { createRequire as __cjsRequire } from 'node:module';
2
+ const require = __cjsRequire(import.meta.url);
3
+ import {
4
+ init_define_import_meta_env
5
+ } from "./token-goat-hook-chunk-7WC2H3EW.mjs";
6
+
7
+ // src/reset.ts
8
+ init_define_import_meta_env();
9
+ var _resets = [];
10
+ function registerReset(fn) {
11
+ _resets.push(fn);
12
+ }
13
+ function clearModuleCaches() {
14
+ const errors = [];
15
+ for (const fn of _resets) {
16
+ try {
17
+ fn();
18
+ } catch (err) {
19
+ errors.push(err);
20
+ }
21
+ }
22
+ if (errors.length === 1) {
23
+ throw errors[0];
24
+ }
25
+ if (errors.length > 1) {
26
+ throw new AggregateError(errors, "clearModuleCaches: one or more resets failed");
27
+ }
28
+ }
29
+
30
+ export {
31
+ registerReset,
32
+ clearModuleCaches
33
+ };