@alterior/common 3.9.1 → 3.13.4

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.
Files changed (162) hide show
  1. package/dist/base64.d.ts +6 -6
  2. package/dist/base64.js +52 -52
  3. package/dist/base64.js.map +1 -1
  4. package/dist/base64.test.d.ts +1 -1
  5. package/dist/cache.d.ts +84 -84
  6. package/dist/cache.js +148 -148
  7. package/dist/cache.js.map +1 -1
  8. package/dist/cache.test.d.ts +1 -1
  9. package/dist/check-native-async.d.ts +1 -1
  10. package/dist/check-native-async.js +27 -28
  11. package/dist/check-native-async.js.map +1 -1
  12. package/dist/clone.d.ts +23 -23
  13. package/dist/clone.js +59 -60
  14. package/dist/clone.js.map +1 -1
  15. package/dist/clone.test.d.ts +1 -1
  16. package/dist/coalesce.d.ts +5 -5
  17. package/dist/coalesce.js +15 -16
  18. package/dist/coalesce.js.map +1 -1
  19. package/dist/coalesce.test.d.ts +1 -1
  20. package/dist/colors.d.ts +62 -62
  21. package/dist/colors.js +66 -66
  22. package/dist/console.d.ts +31 -31
  23. package/dist/console.d.ts.map +1 -1
  24. package/dist/console.js +65 -86
  25. package/dist/console.js.map +1 -1
  26. package/dist/constructor.d.ts +6 -6
  27. package/dist/constructor.js +2 -2
  28. package/dist/decorators.d.ts +1 -1
  29. package/dist/decorators.d.ts.map +1 -1
  30. package/dist/decorators.js +6 -7
  31. package/dist/decorators.js.map +1 -1
  32. package/dist/environment.d.ts +11 -11
  33. package/dist/environment.d.ts.map +1 -1
  34. package/dist/environment.js +27 -27
  35. package/dist/environment.js.map +1 -1
  36. package/dist/errors.d.ts +66 -66
  37. package/dist/errors.js +133 -133
  38. package/dist/errors.test.d.ts +1 -1
  39. package/dist/get-param-names.d.ts +5 -5
  40. package/dist/get-param-names.js +48 -49
  41. package/dist/get-param-names.js.map +1 -1
  42. package/dist/index.d.ts +20 -20
  43. package/dist/index.js +23 -23
  44. package/dist/is-constructor.d.ts +12 -12
  45. package/dist/is-constructor.js +28 -29
  46. package/dist/is-constructor.js.map +1 -1
  47. package/dist/is-constructor.test.d.ts +1 -1
  48. package/dist/lazy-promise.d.ts +14 -14
  49. package/dist/lazy-promise.js +32 -32
  50. package/dist/lazy-promise.js.map +1 -1
  51. package/dist/lazy-subject.d.ts +22 -22
  52. package/dist/lazy-subject.js +22 -23
  53. package/dist/lazy-subject.js.map +1 -1
  54. package/dist/locks.d.ts +23 -23
  55. package/dist/locks.js +76 -76
  56. package/dist/locks.js.map +1 -1
  57. package/dist/locks.test.d.ts +1 -1
  58. package/dist/locks.test.js.map +1 -1
  59. package/dist/padding.d.ts +22 -22
  60. package/dist/padding.js +42 -43
  61. package/dist/padding.js.map +1 -1
  62. package/dist/presentation.d.ts +49 -49
  63. package/dist/presentation.d.ts.map +1 -1
  64. package/dist/presentation.js +132 -132
  65. package/dist/presentation.js.map +1 -1
  66. package/dist/presentation.test.d.ts +1 -1
  67. package/dist/presentation.test.js.map +1 -1
  68. package/dist/serializer.d.ts +8 -8
  69. package/dist/serializer.js +23 -24
  70. package/dist/serializer.js.map +1 -1
  71. package/dist/test.d.ts +2 -2
  72. package/dist/time.d.ts +9 -9
  73. package/dist/time.js +22 -22
  74. package/dist/time.js.map +1 -1
  75. package/dist/timeout.d.ts +13 -13
  76. package/dist/timeout.js +27 -28
  77. package/dist/timeout.js.map +1 -1
  78. package/dist/zones.d.ts +46 -46
  79. package/dist/zones.js +139 -139
  80. package/dist/zones.js.map +1 -1
  81. package/dist.esm/base64.d.ts +6 -6
  82. package/dist.esm/base64.js +48 -48
  83. package/dist.esm/base64.js.map +1 -1
  84. package/dist.esm/base64.test.d.ts +1 -1
  85. package/dist.esm/cache.d.ts +84 -84
  86. package/dist.esm/cache.js +144 -144
  87. package/dist.esm/cache.js.map +1 -1
  88. package/dist.esm/cache.test.d.ts +1 -1
  89. package/dist.esm/check-native-async.d.ts +1 -1
  90. package/dist.esm/check-native-async.js +24 -24
  91. package/dist.esm/check-native-async.js.map +1 -1
  92. package/dist.esm/clone.d.ts +23 -23
  93. package/dist.esm/clone.js +53 -53
  94. package/dist.esm/clone.js.map +1 -1
  95. package/dist.esm/clone.test.d.ts +1 -1
  96. package/dist.esm/coalesce.d.ts +5 -5
  97. package/dist.esm/coalesce.js +12 -12
  98. package/dist.esm/coalesce.js.map +1 -1
  99. package/dist.esm/coalesce.test.d.ts +1 -1
  100. package/dist.esm/colors.d.ts +62 -62
  101. package/dist.esm/colors.js +63 -63
  102. package/dist.esm/console.d.ts +31 -31
  103. package/dist.esm/console.d.ts.map +1 -1
  104. package/dist.esm/console.js +60 -80
  105. package/dist.esm/console.js.map +1 -1
  106. package/dist.esm/constructor.d.ts +6 -6
  107. package/dist.esm/constructor.js +1 -1
  108. package/dist.esm/decorators.d.ts +1 -1
  109. package/dist.esm/decorators.d.ts.map +1 -1
  110. package/dist.esm/decorators.js +3 -3
  111. package/dist.esm/environment.d.ts +11 -11
  112. package/dist.esm/environment.d.ts.map +1 -1
  113. package/dist.esm/environment.js +24 -24
  114. package/dist.esm/environment.js.map +1 -1
  115. package/dist.esm/errors.d.ts +66 -66
  116. package/dist.esm/errors.js +115 -115
  117. package/dist.esm/errors.test.d.ts +1 -1
  118. package/dist.esm/get-param-names.d.ts +5 -5
  119. package/dist.esm/get-param-names.js +45 -45
  120. package/dist.esm/get-param-names.js.map +1 -1
  121. package/dist.esm/index.d.ts +20 -20
  122. package/dist.esm/index.js +20 -20
  123. package/dist.esm/is-constructor.d.ts +12 -12
  124. package/dist.esm/is-constructor.js +24 -24
  125. package/dist.esm/is-constructor.js.map +1 -1
  126. package/dist.esm/is-constructor.test.d.ts +1 -1
  127. package/dist.esm/lazy-promise.d.ts +14 -14
  128. package/dist.esm/lazy-promise.js +28 -28
  129. package/dist.esm/lazy-promise.js.map +1 -1
  130. package/dist.esm/lazy-subject.d.ts +22 -22
  131. package/dist.esm/lazy-subject.js +19 -19
  132. package/dist.esm/locks.d.ts +23 -23
  133. package/dist.esm/locks.js +71 -71
  134. package/dist.esm/locks.js.map +1 -1
  135. package/dist.esm/locks.test.d.ts +1 -1
  136. package/dist.esm/locks.test.js.map +1 -1
  137. package/dist.esm/padding.d.ts +22 -22
  138. package/dist.esm/padding.js +37 -37
  139. package/dist.esm/presentation.d.ts +49 -49
  140. package/dist.esm/presentation.d.ts.map +1 -1
  141. package/dist.esm/presentation.js +126 -126
  142. package/dist.esm/presentation.js.map +1 -1
  143. package/dist.esm/presentation.test.d.ts +1 -1
  144. package/dist.esm/presentation.test.js.map +1 -1
  145. package/dist.esm/serializer.d.ts +8 -8
  146. package/dist.esm/serializer.js +20 -20
  147. package/dist.esm/test.d.ts +2 -2
  148. package/dist.esm/time.d.ts +9 -9
  149. package/dist.esm/time.js +19 -19
  150. package/dist.esm/time.js.map +1 -1
  151. package/dist.esm/timeout.d.ts +13 -13
  152. package/dist.esm/timeout.js +23 -23
  153. package/dist.esm/tsconfig.esm.tsbuildinfo +1 -0
  154. package/dist.esm/zones.d.ts +46 -46
  155. package/dist.esm/zones.js +135 -135
  156. package/dist.esm/zones.js.map +1 -1
  157. package/package.json +11 -8
  158. package/src/console.ts +2 -22
  159. package/src/environment.ts +2 -0
  160. package/tsconfig.esm.json +0 -3
  161. package/tsconfig.json +0 -2
  162. package/tsconfig.tsbuildinfo +1 -3791
@@ -1,85 +1,85 @@
1
- interface CacheEntry<T> {
2
- key: string;
3
- time: number;
4
- expiresAt: number;
5
- lastFetched: number;
6
- value: T;
7
- }
8
- interface CacheFetcher<T> {
9
- (): Promise<T>;
10
- }
11
- interface FetchOptions {
12
- /**
13
- * The time to live to set for a fulfilled item
14
- */
15
- timeToLive?: number;
16
- /**
17
- * What kind of cache miss strategy should be used here.
18
- * - "fulfill" [default]:
19
- * If the cache misses for any reason, wait until the new value is fetched and return it.
20
- * - "stale-revalidate":
21
- * If the cache misses due to an expired value, return the expired (stale) value
22
- * and call the fetcher to update the value in the background.
23
- */
24
- missStrategy?: "fulfill" | "stale-revalidate";
25
- }
26
- /**
27
- * Provides a generic caching mechanism useful for a number of cases
28
- */
29
- export declare class Cache<T> {
30
- private timeToLive;
31
- private maxItems;
32
- /**
33
- *
34
- * @param timeToLive Time a cached item should live before expiring, in milliseconds
35
- * @param maxItems Amount of items that can be held in the cache maximum.
36
- */
37
- constructor(timeToLive: number, maxItems: number);
38
- private entries;
39
- /**
40
- * Cache cleanup routine run whenever a value is stored in the cache
41
- */
42
- private sliceCleanup;
43
- getOldestEntry(): CacheEntry<T>;
44
- /**
45
- * Insert the specified item into the cache under the given key,
46
- * optionally specifying a custom time-to-live. If no time-to-live
47
- * is specified, the class-wide default is used.
48
- *
49
- * @param key The key for the cache entry
50
- * @param value The value to cache
51
- * @param timeToLive How long the value should remain valid for before revalidation
52
- */
53
- insertItem(key: string, value: T, timeToLive?: number): void;
54
- private outstandingFetches;
55
- /**
56
- * Get the value present in the cache for the given key regardless
57
- * of the cache entry's expiration status.
58
- *
59
- * @param key The key to get
60
- */
61
- get(key: string): T;
62
- /**
63
- * Get the cache entry for the given key.
64
- * @param key The key to get
65
- */
66
- getEntry(key: string): CacheEntry<T>;
67
- /**
68
- * Fetch a value from the cache, calling the given function to
69
- * generate the value if it is not present or it is expired.
70
- * The result of the function is then cached for future calls.
71
- *
72
- * Use `options.missStrategy` to control the revalidation behavior. The default value ("fulfill") will
73
- * wait until the fetch operation completes to return a value in the case where a cache miss occurs,
74
- * even if an expired cache value is present. The "stale-revalidate" option will instead return the
75
- * value found in the cache even when expired, executing the fetch operation if the value is expired
76
- * and saving the resulting value back into the cache for future calls.
77
- *
78
- * @param key The key to fetch
79
- * @param fetcher A function to define the value of the key if a cache miss occurs
80
- * @param options Options for doing the caching.
81
- */
82
- fetch(key: string, fetcher?: CacheFetcher<T>, options?: FetchOptions): Promise<T>;
83
- }
84
- export {};
1
+ interface CacheEntry<T> {
2
+ key: string;
3
+ time: number;
4
+ expiresAt: number;
5
+ lastFetched: number;
6
+ value: T;
7
+ }
8
+ interface CacheFetcher<T> {
9
+ (): Promise<T>;
10
+ }
11
+ interface FetchOptions {
12
+ /**
13
+ * The time to live to set for a fulfilled item
14
+ */
15
+ timeToLive?: number;
16
+ /**
17
+ * What kind of cache miss strategy should be used here.
18
+ * - "fulfill" [default]:
19
+ * If the cache misses for any reason, wait until the new value is fetched and return it.
20
+ * - "stale-revalidate":
21
+ * If the cache misses due to an expired value, return the expired (stale) value
22
+ * and call the fetcher to update the value in the background.
23
+ */
24
+ missStrategy?: "fulfill" | "stale-revalidate";
25
+ }
26
+ /**
27
+ * Provides a generic caching mechanism useful for a number of cases
28
+ */
29
+ export declare class Cache<T> {
30
+ private timeToLive;
31
+ private maxItems;
32
+ /**
33
+ *
34
+ * @param timeToLive Time a cached item should live before expiring, in milliseconds
35
+ * @param maxItems Amount of items that can be held in the cache maximum.
36
+ */
37
+ constructor(timeToLive: number, maxItems: number);
38
+ private entries;
39
+ /**
40
+ * Cache cleanup routine run whenever a value is stored in the cache
41
+ */
42
+ private sliceCleanup;
43
+ getOldestEntry(): CacheEntry<T>;
44
+ /**
45
+ * Insert the specified item into the cache under the given key,
46
+ * optionally specifying a custom time-to-live. If no time-to-live
47
+ * is specified, the class-wide default is used.
48
+ *
49
+ * @param key The key for the cache entry
50
+ * @param value The value to cache
51
+ * @param timeToLive How long the value should remain valid for before revalidation
52
+ */
53
+ insertItem(key: string, value: T, timeToLive?: number): void;
54
+ private outstandingFetches;
55
+ /**
56
+ * Get the value present in the cache for the given key regardless
57
+ * of the cache entry's expiration status.
58
+ *
59
+ * @param key The key to get
60
+ */
61
+ get(key: string): T;
62
+ /**
63
+ * Get the cache entry for the given key.
64
+ * @param key The key to get
65
+ */
66
+ getEntry(key: string): CacheEntry<T>;
67
+ /**
68
+ * Fetch a value from the cache, calling the given function to
69
+ * generate the value if it is not present or it is expired.
70
+ * The result of the function is then cached for future calls.
71
+ *
72
+ * Use `options.missStrategy` to control the revalidation behavior. The default value ("fulfill") will
73
+ * wait until the fetch operation completes to return a value in the case where a cache miss occurs,
74
+ * even if an expired cache value is present. The "stale-revalidate" option will instead return the
75
+ * value found in the cache even when expired, executing the fetch operation if the value is expired
76
+ * and saving the resulting value back into the cache for future calls.
77
+ *
78
+ * @param key The key to fetch
79
+ * @param fetcher A function to define the value of the key if a cache miss occurs
80
+ * @param options Options for doing the caching.
81
+ */
82
+ fetch(key: string, fetcher?: CacheFetcher<T>, options?: FetchOptions): Promise<T>;
83
+ }
84
+ export {};
85
85
  //# sourceMappingURL=cache.d.ts.map
package/dist.esm/cache.js CHANGED
@@ -1,145 +1,145 @@
1
- import { __awaiter } from "tslib";
2
- import { deepClone } from "./clone";
3
- /**
4
- * Provides a generic caching mechanism useful for a number of cases
5
- */
6
- export class Cache {
7
- /**
8
- *
9
- * @param timeToLive Time a cached item should live before expiring, in milliseconds
10
- * @param maxItems Amount of items that can be held in the cache maximum.
11
- */
12
- constructor(timeToLive, maxItems) {
13
- this.timeToLive = timeToLive;
14
- this.maxItems = maxItems;
15
- this.entries = {};
16
- this.outstandingFetches = new Map();
17
- }
18
- /**
19
- * Cache cleanup routine run whenever a value is stored in the cache
20
- */
21
- sliceCleanup() {
22
- return __awaiter(this, void 0, void 0, function* () {
23
- let keys = Object.keys(this.entries);
24
- if (keys.length < this.maxItems)
25
- return;
26
- setTimeout(() => {
27
- // Refresh the current count, and trim the
28
- // cache to the right size, evicting last-fetched item
29
- // first.
30
- keys = Object.keys(this.entries);
31
- let itemCount = keys.length;
32
- while (itemCount > this.maxItems) {
33
- let entry = this.getOldestEntry();
34
- delete this.entries[entry.key];
35
- --itemCount;
36
- }
37
- }, 100);
38
- });
39
- }
40
- getOldestEntry() {
41
- let selectedEntry = null;
42
- for (let key in this.entries) {
43
- let entry = this.entries[key];
44
- if (!selectedEntry || selectedEntry.time > entry.time)
45
- selectedEntry = entry;
46
- }
47
- return selectedEntry;
48
- }
49
- /**
50
- * Insert the specified item into the cache under the given key,
51
- * optionally specifying a custom time-to-live. If no time-to-live
52
- * is specified, the class-wide default is used.
53
- *
54
- * @param key The key for the cache entry
55
- * @param value The value to cache
56
- * @param timeToLive How long the value should remain valid for before revalidation
57
- */
58
- insertItem(key, value, timeToLive) {
59
- if (timeToLive === undefined)
60
- timeToLive = this.timeToLive;
61
- // Compute the value
62
- let now = new Date().getTime();
63
- let entry = this.entries[key] = {
64
- key,
65
- time: now,
66
- expiresAt: now + timeToLive,
67
- lastFetched: now,
68
- value: deepClone(value)
69
- };
70
- this.sliceCleanup();
71
- }
72
- /**
73
- * Get the value present in the cache for the given key regardless
74
- * of the cache entry's expiration status.
75
- *
76
- * @param key The key to get
77
- */
78
- get(key) {
79
- let entry = this.entries[key];
80
- return entry ? deepClone(entry.value) : undefined;
81
- }
82
- /**
83
- * Get the cache entry for the given key.
84
- * @param key The key to get
85
- */
86
- getEntry(key) {
87
- return this.entries[key];
88
- }
89
- /**
90
- * Fetch a value from the cache, calling the given function to
91
- * generate the value if it is not present or it is expired.
92
- * The result of the function is then cached for future calls.
93
- *
94
- * Use `options.missStrategy` to control the revalidation behavior. The default value ("fulfill") will
95
- * wait until the fetch operation completes to return a value in the case where a cache miss occurs,
96
- * even if an expired cache value is present. The "stale-revalidate" option will instead return the
97
- * value found in the cache even when expired, executing the fetch operation if the value is expired
98
- * and saving the resulting value back into the cache for future calls.
99
- *
100
- * @param key The key to fetch
101
- * @param fetcher A function to define the value of the key if a cache miss occurs
102
- * @param options Options for doing the caching.
103
- */
104
- fetch(key, fetcher, options = {}) {
105
- return __awaiter(this, void 0, void 0, function* () {
106
- let existingFetch = this.outstandingFetches.get(key);
107
- if (existingFetch)
108
- return yield existingFetch;
109
- let entry;
110
- let now = Date.now();
111
- let stale = true;
112
- if (key in this.entries) {
113
- entry = this.entries[key];
114
- stale = entry.expiresAt < now;
115
- }
116
- if (!options.missStrategy)
117
- options.missStrategy = 'fulfill';
118
- if (options.missStrategy === 'fulfill')
119
- entry = stale ? undefined : entry;
120
- let fetchOperation;
121
- if (stale && fetcher) {
122
- fetchOperation = new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
123
- // Fetch!
124
- let value;
125
- try {
126
- value = yield fetcher();
127
- if (value !== undefined)
128
- this.insertItem(key, value, options.timeToLive);
129
- resolve(value);
130
- }
131
- catch (e) {
132
- console.error(`Failed to fetch item ${key}:`);
133
- console.error(e);
134
- debugger;
135
- resolve(entry ? deepClone(entry.value) : undefined);
136
- }
137
- }));
138
- fetchOperation.finally(() => this.outstandingFetches.delete(key));
139
- this.outstandingFetches.set(key, fetchOperation);
140
- }
141
- return entry ? deepClone(entry.value) : yield fetchOperation;
142
- });
143
- }
144
- }
1
+ import { __awaiter } from "tslib";
2
+ import { deepClone } from "./clone";
3
+ /**
4
+ * Provides a generic caching mechanism useful for a number of cases
5
+ */
6
+ export class Cache {
7
+ /**
8
+ *
9
+ * @param timeToLive Time a cached item should live before expiring, in milliseconds
10
+ * @param maxItems Amount of items that can be held in the cache maximum.
11
+ */
12
+ constructor(timeToLive, maxItems) {
13
+ this.timeToLive = timeToLive;
14
+ this.maxItems = maxItems;
15
+ this.entries = {};
16
+ this.outstandingFetches = new Map();
17
+ }
18
+ /**
19
+ * Cache cleanup routine run whenever a value is stored in the cache
20
+ */
21
+ sliceCleanup() {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ let keys = Object.keys(this.entries);
24
+ if (keys.length < this.maxItems)
25
+ return;
26
+ setTimeout(() => {
27
+ // Refresh the current count, and trim the
28
+ // cache to the right size, evicting last-fetched item
29
+ // first.
30
+ keys = Object.keys(this.entries);
31
+ let itemCount = keys.length;
32
+ while (itemCount > this.maxItems) {
33
+ let entry = this.getOldestEntry();
34
+ delete this.entries[entry.key];
35
+ --itemCount;
36
+ }
37
+ }, 100);
38
+ });
39
+ }
40
+ getOldestEntry() {
41
+ let selectedEntry = null;
42
+ for (let key in this.entries) {
43
+ let entry = this.entries[key];
44
+ if (!selectedEntry || selectedEntry.time > entry.time)
45
+ selectedEntry = entry;
46
+ }
47
+ return selectedEntry;
48
+ }
49
+ /**
50
+ * Insert the specified item into the cache under the given key,
51
+ * optionally specifying a custom time-to-live. If no time-to-live
52
+ * is specified, the class-wide default is used.
53
+ *
54
+ * @param key The key for the cache entry
55
+ * @param value The value to cache
56
+ * @param timeToLive How long the value should remain valid for before revalidation
57
+ */
58
+ insertItem(key, value, timeToLive) {
59
+ if (timeToLive === undefined)
60
+ timeToLive = this.timeToLive;
61
+ // Compute the value
62
+ let now = new Date().getTime();
63
+ let entry = this.entries[key] = {
64
+ key,
65
+ time: now,
66
+ expiresAt: now + timeToLive,
67
+ lastFetched: now,
68
+ value: deepClone(value)
69
+ };
70
+ this.sliceCleanup();
71
+ }
72
+ /**
73
+ * Get the value present in the cache for the given key regardless
74
+ * of the cache entry's expiration status.
75
+ *
76
+ * @param key The key to get
77
+ */
78
+ get(key) {
79
+ let entry = this.entries[key];
80
+ return entry ? deepClone(entry.value) : undefined;
81
+ }
82
+ /**
83
+ * Get the cache entry for the given key.
84
+ * @param key The key to get
85
+ */
86
+ getEntry(key) {
87
+ return this.entries[key];
88
+ }
89
+ /**
90
+ * Fetch a value from the cache, calling the given function to
91
+ * generate the value if it is not present or it is expired.
92
+ * The result of the function is then cached for future calls.
93
+ *
94
+ * Use `options.missStrategy` to control the revalidation behavior. The default value ("fulfill") will
95
+ * wait until the fetch operation completes to return a value in the case where a cache miss occurs,
96
+ * even if an expired cache value is present. The "stale-revalidate" option will instead return the
97
+ * value found in the cache even when expired, executing the fetch operation if the value is expired
98
+ * and saving the resulting value back into the cache for future calls.
99
+ *
100
+ * @param key The key to fetch
101
+ * @param fetcher A function to define the value of the key if a cache miss occurs
102
+ * @param options Options for doing the caching.
103
+ */
104
+ fetch(key_1, fetcher_1) {
105
+ return __awaiter(this, arguments, void 0, function* (key, fetcher, options = {}) {
106
+ let existingFetch = this.outstandingFetches.get(key);
107
+ if (existingFetch)
108
+ return yield existingFetch;
109
+ let entry;
110
+ let now = Date.now();
111
+ let stale = true;
112
+ if (key in this.entries) {
113
+ entry = this.entries[key];
114
+ stale = entry.expiresAt < now;
115
+ }
116
+ if (!options.missStrategy)
117
+ options.missStrategy = 'fulfill';
118
+ if (options.missStrategy === 'fulfill')
119
+ entry = stale ? undefined : entry;
120
+ let fetchOperation;
121
+ if (stale && fetcher) {
122
+ fetchOperation = new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
123
+ // Fetch!
124
+ let value;
125
+ try {
126
+ value = yield fetcher();
127
+ if (value !== undefined)
128
+ this.insertItem(key, value, options.timeToLive);
129
+ resolve(value);
130
+ }
131
+ catch (e) {
132
+ console.error(`Failed to fetch item ${key}:`);
133
+ console.error(e);
134
+ debugger;
135
+ resolve(entry ? deepClone(entry.value) : undefined);
136
+ }
137
+ }));
138
+ fetchOperation.finally(() => this.outstandingFetches.delete(key));
139
+ this.outstandingFetches.set(key, fetchOperation);
140
+ }
141
+ return entry ? deepClone(entry.value) : yield fetchOperation;
142
+ });
143
+ }
144
+ }
145
145
  //# sourceMappingURL=cache.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cache.js","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAmCpC;;GAEG;AACH,MAAM,OAAO,KAAK;IACd;;;;OAIG;IACH,YAA2B,UAAmB,EAAU,QAAiB;QAA9C,eAAU,GAAV,UAAU,CAAS;QAAU,aAAQ,GAAR,QAAQ,CAAS;QAGjE,YAAO,GAAiB,EAAE,CAAC;QAkE3B,uBAAkB,GAAG,IAAI,GAAG,EAAwB,CAAC;IApE7D,CAAC;IAID;;OAEG;IACW,YAAY;;YAEtB,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACrC,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ;gBAC3B,OAAO;YAEX,UAAU,CAAC,GAAG,EAAE;gBAEZ,2CAA2C;gBAC3C,sDAAsD;gBACtD,SAAS;gBAET,IAAI,GAAG,MA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AAc,GAAG,IAAI,OAAO,CAAC,CAAO,OAAO,EAAE,MAAM,EAAE,EAAE;oBACnD,SAAS;oBACT,IAAI,KAAS,CAAC;oBACd,IAAI,CAAC;wBACD,KAAK,GAAG,MAAM,OAAO,EAAE,CAAC;wBAExB,IAAI,KAAK,KAAK,SAAS;4BACnB,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;wBACpD,OAAO,CAAC,KAAK,CAAC,CAAC;oBACnB,CAAC;oBAAC,OAAO,CAAC,EAAE,CAAC;wBACT,OAAO,CAAC,KAAK,CAAC,wBAAwB,GAAG,GAAG,CAAC,CAAC;wBAC9C,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;wBACjB,QAAQ,CAAC;wBAET,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;oBACxD,CAAC;gBACL,CAAC,CAAA,CAAC,CAAC;gBAEH,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;gBAElE,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;YACrD,CAAC;YAED,OAAO,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,cAAc,CAAC;QACjE,CAAC;KAAA;CACJ"}
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=cache.test.d.ts.map
@@ -1,2 +1,2 @@
1
- export declare function disallowNativeAsync(func: Function): void;
1
+ export declare function disallowNativeAsync(func: Function): void;
2
2
  //# sourceMappingURL=check-native-async.d.ts.map
@@ -1,25 +1,25 @@
1
- export function disallowNativeAsync(func) {
2
- if (typeof func !== 'function')
3
- return;
4
- if (func.constructor.name === 'AsyncFunction') {
5
- console.error();
6
- console.error(`----------------------------------------------------------------------------------------------------`);
7
- console.error(`Detected usage of a native async function in a context where it is not allowed.`);
8
- console.error(`Unfortunately, native async/await is not supported by Alterior, as it breaks Zone tracking.`);
9
- console.error(`Please ensure compilerOptions.target is set to ES2016 or lower, and keep in mind that `);
10
- console.error(`dependencies compiled with native async/await support may cause problems for some Alterior features.`);
11
- console.error(`For more information see https://github.com/angular/angular/issues/31730`);
12
- console.error();
13
- console.error(`**Please support the AsyncContext proposal which will help solve this problem**`);
14
- console.error(` https://github.com/tc39/proposal-async-context`);
15
- console.error();
16
- console.error(`Context:`);
17
- console.error(` - Function name: ${func.name}`);
18
- console.error(` - Function implementation:`);
19
- console.error(` ${String(func).replace(/\n/g, "\n ")}`);
20
- console.error(`----------------------------------------------------------------------------------------------------`);
21
- console.error();
22
- throw new Error(`Native async/await is not supported [${func.name}()].`);
23
- }
24
- }
1
+ export function disallowNativeAsync(func) {
2
+ if (typeof func !== 'function')
3
+ return;
4
+ if (func.constructor.name === 'AsyncFunction') {
5
+ console.error();
6
+ console.error(`----------------------------------------------------------------------------------------------------`);
7
+ console.error(`Detected usage of a native async function in a context where it is not allowed.`);
8
+ console.error(`Unfortunately, native async/await is not supported by Alterior, as it breaks Zone tracking.`);
9
+ console.error(`Please ensure compilerOptions.target is set to ES2016 or lower, and keep in mind that `);
10
+ console.error(`dependencies compiled with native async/await support may cause problems for some Alterior features.`);
11
+ console.error(`For more information see https://github.com/angular/angular/issues/31730`);
12
+ console.error();
13
+ console.error(`**Please support the AsyncContext proposal which will help solve this problem**`);
14
+ console.error(` https://github.com/tc39/proposal-async-context`);
15
+ console.error();
16
+ console.error(`Context:`);
17
+ console.error(` - Function name: ${func.name}`);
18
+ console.error(` - Function implementation:`);
19
+ console.error(` ${String(func).replace(/\n/g, "\n ")}`);
20
+ console.error(`----------------------------------------------------------------------------------------------------`);
21
+ console.error();
22
+ throw new Error(`Native async/await is not supported [${func.name}()].`);
23
+ }
24
+ }
25
25
  //# sourceMappingURL=check-native-async.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"check-native-async.js","sourceRoot":"","sources":["../src/check-native-async.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,mBAAmB,CAAC,IAAc;IAC9C,IAAI,OAAO,IAAI,KAAK,UAAU;QAC1B,OAAO;IAEX,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,eAAe,EAAE;QAC3C,OAAO,CAAC,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,sGAAsG,CAAC,CAAC;QACtH,OAAO,CAAC,KAAK,CAAC,iFAAiF,CAAC,CAAC;QACjG,OAAO,CAAC,KAAK,CAAC,6FAA6F,CAAC,CAAC;QAC7G,OAAO,CAAC,KAAK,CAAC,wFAAwF,CAAC,CAAC;QACxG,OAAO,CAAC,KAAK,CAAC,sGAAsG,CAAC,CAAC;QACtH,OAAO,CAAC,KAAK,CAAC,0EAA0E,CAAC,CAAC;QAC1F,OAAO,CAAC,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,iFAAiF,CAAC,CAAC;QACjG,OAAO,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC;QACnE,OAAO,CAAC,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC1B,OAAO,CAAC,KAAK,CAAC,qBAAqB,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAChD,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;QAC7C,OAAO,CAAC,KAAK,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QAC5D,OAAO,CAAC,KAAK,CAAC,sGAAsG,CAAC,CAAC;QACtH,OAAO,CAAC,KAAK,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,wCAAwC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,IAAI,MAAM,CAAC,CAAC;IAC7E,CAAC;AACL,CAAC"}
@@ -1,24 +1,24 @@
1
- /**
2
- * Perform a shallow clone of the object, producing one that has the
3
- * same constructor chain and prototype as the passed object.
4
- * @param obj
5
- */
6
- export declare function shallowClone(obj: Object): any;
7
- /**
8
- * Perform a standard clone using serialization (see cloneBySerialization)
9
- * @param obj
10
- */
11
- export declare function clone<T = any>(obj: T): T;
12
- /**
13
- * Deeply clone the given value. If the value is an object, all subobjects
14
- * are deeply cloned as well.
15
- *
16
- * @param o
17
- */
18
- export declare function deepClone(o: any): any;
19
- /**
20
- * Clone the value by serializing it to JSON and back.
21
- * @param obj
22
- */
23
- export declare function cloneBySerialization(obj: any): any;
1
+ /**
2
+ * Perform a shallow clone of the object, producing one that has the
3
+ * same constructor chain and prototype as the passed object.
4
+ * @param obj
5
+ */
6
+ export declare function shallowClone(obj: Object): any;
7
+ /**
8
+ * Perform a standard clone using serialization (see cloneBySerialization)
9
+ * @param obj
10
+ */
11
+ export declare function clone<T = any>(obj: T): T;
12
+ /**
13
+ * Deeply clone the given value. If the value is an object, all subobjects
14
+ * are deeply cloned as well.
15
+ *
16
+ * @param o
17
+ */
18
+ export declare function deepClone(o: any): any;
19
+ /**
20
+ * Clone the value by serializing it to JSON and back.
21
+ * @param obj
22
+ */
23
+ export declare function cloneBySerialization(obj: any): any;
24
24
  //# sourceMappingURL=clone.d.ts.map