@alterior/common 3.13.3 → 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.
- package/dist/base64.d.ts +6 -6
- package/dist/base64.js +52 -52
- package/dist/base64.js.map +1 -1
- package/dist/base64.test.d.ts +1 -1
- package/dist/cache.d.ts +84 -84
- package/dist/cache.js +148 -148
- package/dist/cache.js.map +1 -1
- package/dist/cache.test.d.ts +1 -1
- package/dist/check-native-async.d.ts +1 -1
- package/dist/check-native-async.js +27 -28
- package/dist/check-native-async.js.map +1 -1
- package/dist/clone.d.ts +23 -23
- package/dist/clone.js +59 -60
- package/dist/clone.js.map +1 -1
- package/dist/clone.test.d.ts +1 -1
- package/dist/coalesce.d.ts +5 -5
- package/dist/coalesce.js +15 -16
- package/dist/coalesce.js.map +1 -1
- package/dist/coalesce.test.d.ts +1 -1
- package/dist/colors.d.ts +62 -62
- package/dist/colors.js +66 -66
- package/dist/console.d.ts +31 -31
- package/dist/console.d.ts.map +1 -1
- package/dist/console.js +65 -86
- package/dist/console.js.map +1 -1
- package/dist/constructor.d.ts +6 -6
- package/dist/constructor.js +2 -2
- package/dist/decorators.d.ts +1 -1
- package/dist/decorators.d.ts.map +1 -1
- package/dist/decorators.js +6 -7
- package/dist/decorators.js.map +1 -1
- package/dist/environment.d.ts +11 -11
- package/dist/environment.d.ts.map +1 -1
- package/dist/environment.js +27 -27
- package/dist/environment.js.map +1 -1
- package/dist/errors.d.ts +66 -66
- package/dist/errors.js +133 -133
- package/dist/errors.test.d.ts +1 -1
- package/dist/get-param-names.d.ts +5 -5
- package/dist/get-param-names.js +48 -49
- package/dist/get-param-names.js.map +1 -1
- package/dist/index.d.ts +20 -20
- package/dist/index.js +23 -23
- package/dist/is-constructor.d.ts +12 -12
- package/dist/is-constructor.js +28 -29
- package/dist/is-constructor.js.map +1 -1
- package/dist/is-constructor.test.d.ts +1 -1
- package/dist/lazy-promise.d.ts +14 -14
- package/dist/lazy-promise.js +32 -32
- package/dist/lazy-promise.js.map +1 -1
- package/dist/lazy-subject.d.ts +22 -22
- package/dist/lazy-subject.js +22 -23
- package/dist/lazy-subject.js.map +1 -1
- package/dist/locks.d.ts +23 -23
- package/dist/locks.js +76 -76
- package/dist/locks.js.map +1 -1
- package/dist/locks.test.d.ts +1 -1
- package/dist/locks.test.js.map +1 -1
- package/dist/padding.d.ts +22 -22
- package/dist/padding.js +42 -43
- package/dist/padding.js.map +1 -1
- package/dist/presentation.d.ts +49 -49
- package/dist/presentation.d.ts.map +1 -1
- package/dist/presentation.js +132 -132
- package/dist/presentation.js.map +1 -1
- package/dist/presentation.test.d.ts +1 -1
- package/dist/presentation.test.js.map +1 -1
- package/dist/serializer.d.ts +8 -8
- package/dist/serializer.js +23 -24
- package/dist/serializer.js.map +1 -1
- package/dist/test.d.ts +2 -2
- package/dist/time.d.ts +9 -9
- package/dist/time.js +22 -22
- package/dist/time.js.map +1 -1
- package/dist/timeout.d.ts +13 -13
- package/dist/timeout.js +27 -28
- package/dist/timeout.js.map +1 -1
- package/dist/zones.d.ts +46 -46
- package/dist/zones.js +139 -139
- package/dist/zones.js.map +1 -1
- package/dist.esm/base64.d.ts +6 -6
- package/dist.esm/base64.js +48 -48
- package/dist.esm/base64.js.map +1 -1
- package/dist.esm/base64.test.d.ts +1 -1
- package/dist.esm/cache.d.ts +84 -84
- package/dist.esm/cache.js +144 -144
- package/dist.esm/cache.js.map +1 -1
- package/dist.esm/cache.test.d.ts +1 -1
- package/dist.esm/check-native-async.d.ts +1 -1
- package/dist.esm/check-native-async.js +24 -24
- package/dist.esm/check-native-async.js.map +1 -1
- package/dist.esm/clone.d.ts +23 -23
- package/dist.esm/clone.js +53 -53
- package/dist.esm/clone.js.map +1 -1
- package/dist.esm/clone.test.d.ts +1 -1
- package/dist.esm/coalesce.d.ts +5 -5
- package/dist.esm/coalesce.js +12 -12
- package/dist.esm/coalesce.js.map +1 -1
- package/dist.esm/coalesce.test.d.ts +1 -1
- package/dist.esm/colors.d.ts +62 -62
- package/dist.esm/colors.js +63 -63
- package/dist.esm/console.d.ts +31 -31
- package/dist.esm/console.d.ts.map +1 -1
- package/dist.esm/console.js +60 -80
- package/dist.esm/console.js.map +1 -1
- package/dist.esm/constructor.d.ts +6 -6
- package/dist.esm/constructor.js +1 -1
- package/dist.esm/decorators.d.ts +1 -1
- package/dist.esm/decorators.d.ts.map +1 -1
- package/dist.esm/decorators.js +3 -3
- package/dist.esm/environment.d.ts +11 -11
- package/dist.esm/environment.d.ts.map +1 -1
- package/dist.esm/environment.js +24 -24
- package/dist.esm/environment.js.map +1 -1
- package/dist.esm/errors.d.ts +66 -66
- package/dist.esm/errors.js +115 -115
- package/dist.esm/errors.test.d.ts +1 -1
- package/dist.esm/get-param-names.d.ts +5 -5
- package/dist.esm/get-param-names.js +45 -45
- package/dist.esm/get-param-names.js.map +1 -1
- package/dist.esm/index.d.ts +20 -20
- package/dist.esm/index.js +20 -20
- package/dist.esm/is-constructor.d.ts +12 -12
- package/dist.esm/is-constructor.js +24 -24
- package/dist.esm/is-constructor.js.map +1 -1
- package/dist.esm/is-constructor.test.d.ts +1 -1
- package/dist.esm/lazy-promise.d.ts +14 -14
- package/dist.esm/lazy-promise.js +28 -28
- package/dist.esm/lazy-promise.js.map +1 -1
- package/dist.esm/lazy-subject.d.ts +22 -22
- package/dist.esm/lazy-subject.js +19 -19
- package/dist.esm/locks.d.ts +23 -23
- package/dist.esm/locks.js +71 -71
- package/dist.esm/locks.js.map +1 -1
- package/dist.esm/locks.test.d.ts +1 -1
- package/dist.esm/locks.test.js.map +1 -1
- package/dist.esm/padding.d.ts +22 -22
- package/dist.esm/padding.js +37 -37
- package/dist.esm/presentation.d.ts +49 -49
- package/dist.esm/presentation.d.ts.map +1 -1
- package/dist.esm/presentation.js +126 -126
- package/dist.esm/presentation.js.map +1 -1
- package/dist.esm/presentation.test.d.ts +1 -1
- package/dist.esm/presentation.test.js.map +1 -1
- package/dist.esm/serializer.d.ts +8 -8
- package/dist.esm/serializer.js +20 -20
- package/dist.esm/test.d.ts +2 -2
- package/dist.esm/time.d.ts +9 -9
- package/dist.esm/time.js +19 -19
- package/dist.esm/time.js.map +1 -1
- package/dist.esm/timeout.d.ts +13 -13
- package/dist.esm/timeout.js +23 -23
- package/dist.esm/tsconfig.esm.tsbuildinfo +1 -0
- package/dist.esm/zones.d.ts +46 -46
- package/dist.esm/zones.js +135 -135
- package/dist.esm/zones.js.map +1 -1
- package/package.json +10 -7
- package/src/console.ts +2 -22
- package/src/environment.ts +2 -0
- package/tsconfig.esm.json +0 -3
- package/tsconfig.json +0 -2
- package/tsconfig.tsbuildinfo +1 -3791
package/dist/base64.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare class Base64 {
|
|
2
|
-
static encode(str: string): string;
|
|
3
|
-
static encodeBytes(bytes: Uint8Array): string;
|
|
4
|
-
static decode(str: string): string;
|
|
5
|
-
static decodeBytes(str: string): Uint8Array;
|
|
6
|
-
}
|
|
1
|
+
export declare class Base64 {
|
|
2
|
+
static encode(str: string): string;
|
|
3
|
+
static encodeBytes(bytes: Uint8Array): string;
|
|
4
|
+
static decode(str: string): string;
|
|
5
|
+
static decodeBytes(str: string): Uint8Array;
|
|
6
|
+
}
|
|
7
7
|
//# sourceMappingURL=base64.d.ts.map
|
package/dist/base64.js
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Base64 = void 0;
|
|
4
|
-
const BASE64_KEY = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
|
5
|
-
class Base64 {
|
|
6
|
-
static encode(str) {
|
|
7
|
-
return this.encodeBytes(new TextEncoder().encode(str));
|
|
8
|
-
}
|
|
9
|
-
static encodeBytes(bytes) {
|
|
10
|
-
let output = '';
|
|
11
|
-
let inputPad = bytes.length % 3 === 0 ? 0 : 3 - bytes.length % 3;
|
|
12
|
-
let buffer = new Uint8Array(bytes.length + inputPad);
|
|
13
|
-
buffer.set(bytes, 0);
|
|
14
|
-
for (let i = 0, max = buffer.length; i < max; i += 3) {
|
|
15
|
-
let value = buffer[i + 0] << 16
|
|
16
|
-
| buffer[i + 1] << 8
|
|
17
|
-
| buffer[i + 2];
|
|
18
|
-
let char1 = (value >> 18) & 0x3f;
|
|
19
|
-
let char2 = (value >> 12) & 0x3f;
|
|
20
|
-
let char3 = (value >> 6) & 0x3f;
|
|
21
|
-
let char4 = (value >> 0) & 0x3f;
|
|
22
|
-
output += BASE64_KEY[char1];
|
|
23
|
-
output += BASE64_KEY[char2];
|
|
24
|
-
output += BASE64_KEY[char3];
|
|
25
|
-
output += BASE64_KEY[char4];
|
|
26
|
-
}
|
|
27
|
-
let outputPad = Math.floor(inputPad * 8 / 6);
|
|
28
|
-
if (outputPad !== 0)
|
|
29
|
-
output = output.slice(0, -outputPad) + Array(outputPad + 1).join('=');
|
|
30
|
-
return output;
|
|
31
|
-
}
|
|
32
|
-
static decode(str) {
|
|
33
|
-
return new TextDecoder().decode(this.decodeBytes(str));
|
|
34
|
-
}
|
|
35
|
-
static decodeBytes(str) {
|
|
36
|
-
str = str.replace(/=+$/g, '');
|
|
37
|
-
let paddingRequired = str.length % 4 === 0 ? 0 : 4 - str.length % 4;
|
|
38
|
-
str += Array(paddingRequired + 1).join('=');
|
|
39
|
-
let decoded = new Uint8Array(str.length * 6 / 8);
|
|
40
|
-
for (let i = 0, max = str.length; i < max; i += 4) {
|
|
41
|
-
let value = BASE64_KEY.indexOf(str[i + 0]) << 18
|
|
42
|
-
| BASE64_KEY.indexOf(str[i + 1]) << 12
|
|
43
|
-
| BASE64_KEY.indexOf(str[i + 2]) << 6
|
|
44
|
-
| BASE64_KEY.indexOf(str[i + 3]) << 0;
|
|
45
|
-
decoded[i / 4 * 3 + 0] = value >> 16 & 0xFF;
|
|
46
|
-
decoded[i / 4 * 3 + 1] = value >> 8 & 0xFF;
|
|
47
|
-
decoded[i / 4 * 3 + 2] = value >> 0 & 0xFF;
|
|
48
|
-
}
|
|
49
|
-
return decoded.subarray(0, decoded.length - paddingRequired);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
exports.Base64 = Base64;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Base64 = void 0;
|
|
4
|
+
const BASE64_KEY = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
|
5
|
+
class Base64 {
|
|
6
|
+
static encode(str) {
|
|
7
|
+
return this.encodeBytes(new TextEncoder().encode(str));
|
|
8
|
+
}
|
|
9
|
+
static encodeBytes(bytes) {
|
|
10
|
+
let output = '';
|
|
11
|
+
let inputPad = bytes.length % 3 === 0 ? 0 : 3 - bytes.length % 3;
|
|
12
|
+
let buffer = new Uint8Array(bytes.length + inputPad);
|
|
13
|
+
buffer.set(bytes, 0);
|
|
14
|
+
for (let i = 0, max = buffer.length; i < max; i += 3) {
|
|
15
|
+
let value = buffer[i + 0] << 16
|
|
16
|
+
| buffer[i + 1] << 8
|
|
17
|
+
| buffer[i + 2];
|
|
18
|
+
let char1 = (value >> 18) & 0x3f;
|
|
19
|
+
let char2 = (value >> 12) & 0x3f;
|
|
20
|
+
let char3 = (value >> 6) & 0x3f;
|
|
21
|
+
let char4 = (value >> 0) & 0x3f;
|
|
22
|
+
output += BASE64_KEY[char1];
|
|
23
|
+
output += BASE64_KEY[char2];
|
|
24
|
+
output += BASE64_KEY[char3];
|
|
25
|
+
output += BASE64_KEY[char4];
|
|
26
|
+
}
|
|
27
|
+
let outputPad = Math.floor(inputPad * 8 / 6);
|
|
28
|
+
if (outputPad !== 0)
|
|
29
|
+
output = output.slice(0, -outputPad) + Array(outputPad + 1).join('=');
|
|
30
|
+
return output;
|
|
31
|
+
}
|
|
32
|
+
static decode(str) {
|
|
33
|
+
return new TextDecoder().decode(this.decodeBytes(str));
|
|
34
|
+
}
|
|
35
|
+
static decodeBytes(str) {
|
|
36
|
+
str = str.replace(/=+$/g, '');
|
|
37
|
+
let paddingRequired = str.length % 4 === 0 ? 0 : 4 - str.length % 4;
|
|
38
|
+
str += Array(paddingRequired + 1).join('=');
|
|
39
|
+
let decoded = new Uint8Array(str.length * 6 / 8);
|
|
40
|
+
for (let i = 0, max = str.length; i < max; i += 4) {
|
|
41
|
+
let value = BASE64_KEY.indexOf(str[i + 0]) << 18
|
|
42
|
+
| BASE64_KEY.indexOf(str[i + 1]) << 12
|
|
43
|
+
| BASE64_KEY.indexOf(str[i + 2]) << 6
|
|
44
|
+
| BASE64_KEY.indexOf(str[i + 3]) << 0;
|
|
45
|
+
decoded[i / 4 * 3 + 0] = value >> 16 & 0xFF;
|
|
46
|
+
decoded[i / 4 * 3 + 1] = value >> 8 & 0xFF;
|
|
47
|
+
decoded[i / 4 * 3 + 2] = value >> 0 & 0xFF;
|
|
48
|
+
}
|
|
49
|
+
return decoded.subarray(0, decoded.length - paddingRequired);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.Base64 = Base64;
|
|
53
53
|
//# sourceMappingURL=base64.js.map
|
package/dist/base64.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base64.js","sourceRoot":"","sources":["../src/base64.ts"],"names":[],"mappings":";;;AAAA,MAAM,UAAU,GAAG,mEAAmE,CAAC;AAEvF,MAAa,MAAM;IACf,MAAM,CAAC,MAAM,CAAC,GAAW;QACrB,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3D,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,KAAiB;QAChC,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,QAAQ,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,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+1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=base64.test.d.ts.map
|
package/dist/cache.d.ts
CHANGED
|
@@ -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/cache.js
CHANGED
|
@@ -1,149 +1,149 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Cache = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const clone_1 = require("./clone");
|
|
6
|
-
/**
|
|
7
|
-
* Provides a generic caching mechanism useful for a number of cases
|
|
8
|
-
*/
|
|
9
|
-
class Cache {
|
|
10
|
-
/**
|
|
11
|
-
*
|
|
12
|
-
* @param timeToLive Time a cached item should live before expiring, in milliseconds
|
|
13
|
-
* @param maxItems Amount of items that can be held in the cache maximum.
|
|
14
|
-
*/
|
|
15
|
-
constructor(timeToLive, maxItems) {
|
|
16
|
-
this.timeToLive = timeToLive;
|
|
17
|
-
this.maxItems = maxItems;
|
|
18
|
-
this.entries = {};
|
|
19
|
-
this.outstandingFetches = new Map();
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Cache cleanup routine run whenever a value is stored in the cache
|
|
23
|
-
*/
|
|
24
|
-
sliceCleanup() {
|
|
25
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
let keys = Object.keys(this.entries);
|
|
27
|
-
if (keys.length < this.maxItems)
|
|
28
|
-
return;
|
|
29
|
-
setTimeout(() => {
|
|
30
|
-
// Refresh the current count, and trim the
|
|
31
|
-
// cache to the right size, evicting last-fetched item
|
|
32
|
-
// first.
|
|
33
|
-
keys = Object.keys(this.entries);
|
|
34
|
-
let itemCount = keys.length;
|
|
35
|
-
while (itemCount > this.maxItems) {
|
|
36
|
-
let entry = this.getOldestEntry();
|
|
37
|
-
delete this.entries[entry.key];
|
|
38
|
-
--itemCount;
|
|
39
|
-
}
|
|
40
|
-
}, 100);
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
getOldestEntry() {
|
|
44
|
-
let selectedEntry = null;
|
|
45
|
-
for (let key in this.entries) {
|
|
46
|
-
let entry = this.entries[key];
|
|
47
|
-
if (!selectedEntry || selectedEntry.time > entry.time)
|
|
48
|
-
selectedEntry = entry;
|
|
49
|
-
}
|
|
50
|
-
return selectedEntry;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Insert the specified item into the cache under the given key,
|
|
54
|
-
* optionally specifying a custom time-to-live. If no time-to-live
|
|
55
|
-
* is specified, the class-wide default is used.
|
|
56
|
-
*
|
|
57
|
-
* @param key The key for the cache entry
|
|
58
|
-
* @param value The value to cache
|
|
59
|
-
* @param timeToLive How long the value should remain valid for before revalidation
|
|
60
|
-
*/
|
|
61
|
-
insertItem(key, value, timeToLive) {
|
|
62
|
-
if (timeToLive === undefined)
|
|
63
|
-
timeToLive = this.timeToLive;
|
|
64
|
-
// Compute the value
|
|
65
|
-
let now = new Date().getTime();
|
|
66
|
-
let entry = this.entries[key] = {
|
|
67
|
-
key,
|
|
68
|
-
time: now,
|
|
69
|
-
expiresAt: now + timeToLive,
|
|
70
|
-
lastFetched: now,
|
|
71
|
-
value: (0, clone_1.deepClone)(value)
|
|
72
|
-
};
|
|
73
|
-
this.sliceCleanup();
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Get the value present in the cache for the given key regardless
|
|
77
|
-
* of the cache entry's expiration status.
|
|
78
|
-
*
|
|
79
|
-
* @param key The key to get
|
|
80
|
-
*/
|
|
81
|
-
get(key) {
|
|
82
|
-
let entry = this.entries[key];
|
|
83
|
-
return entry ? (0, clone_1.deepClone)(entry.value) : undefined;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Get the cache entry for the given key.
|
|
87
|
-
* @param key The key to get
|
|
88
|
-
*/
|
|
89
|
-
getEntry(key) {
|
|
90
|
-
return this.entries[key];
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Fetch a value from the cache, calling the given function to
|
|
94
|
-
* generate the value if it is not present or it is expired.
|
|
95
|
-
* The result of the function is then cached for future calls.
|
|
96
|
-
*
|
|
97
|
-
* Use `options.missStrategy` to control the revalidation behavior. The default value ("fulfill") will
|
|
98
|
-
* wait until the fetch operation completes to return a value in the case where a cache miss occurs,
|
|
99
|
-
* even if an expired cache value is present. The "stale-revalidate" option will instead return the
|
|
100
|
-
* value found in the cache even when expired, executing the fetch operation if the value is expired
|
|
101
|
-
* and saving the resulting value back into the cache for future calls.
|
|
102
|
-
*
|
|
103
|
-
* @param key The key to fetch
|
|
104
|
-
* @param fetcher A function to define the value of the key if a cache miss occurs
|
|
105
|
-
* @param options Options for doing the caching.
|
|
106
|
-
*/
|
|
107
|
-
fetch(
|
|
108
|
-
return tslib_1.__awaiter(this,
|
|
109
|
-
let existingFetch = this.outstandingFetches.get(key);
|
|
110
|
-
if (existingFetch)
|
|
111
|
-
return yield existingFetch;
|
|
112
|
-
let entry;
|
|
113
|
-
let now = Date.now();
|
|
114
|
-
let stale = true;
|
|
115
|
-
if (key in this.entries) {
|
|
116
|
-
entry = this.entries[key];
|
|
117
|
-
stale = entry.expiresAt < now;
|
|
118
|
-
}
|
|
119
|
-
if (!options.missStrategy)
|
|
120
|
-
options.missStrategy = 'fulfill';
|
|
121
|
-
if (options.missStrategy === 'fulfill')
|
|
122
|
-
entry = stale ? undefined : entry;
|
|
123
|
-
let fetchOperation;
|
|
124
|
-
if (stale && fetcher) {
|
|
125
|
-
fetchOperation = new Promise((resolve, reject) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
126
|
-
// Fetch!
|
|
127
|
-
let value;
|
|
128
|
-
try {
|
|
129
|
-
value = yield fetcher();
|
|
130
|
-
if (value !== undefined)
|
|
131
|
-
this.insertItem(key, value, options.timeToLive);
|
|
132
|
-
resolve(value);
|
|
133
|
-
}
|
|
134
|
-
catch (e) {
|
|
135
|
-
console.error(`Failed to fetch item ${key}:`);
|
|
136
|
-
console.error(e);
|
|
137
|
-
debugger;
|
|
138
|
-
resolve(entry ? (0, clone_1.deepClone)(entry.value) : undefined);
|
|
139
|
-
}
|
|
140
|
-
}));
|
|
141
|
-
fetchOperation.finally(() => this.outstandingFetches.delete(key));
|
|
142
|
-
this.outstandingFetches.set(key, fetchOperation);
|
|
143
|
-
}
|
|
144
|
-
return entry ? (0, clone_1.deepClone)(entry.value) : yield fetchOperation;
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
exports.Cache = Cache;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Cache = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const clone_1 = require("./clone");
|
|
6
|
+
/**
|
|
7
|
+
* Provides a generic caching mechanism useful for a number of cases
|
|
8
|
+
*/
|
|
9
|
+
class Cache {
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @param timeToLive Time a cached item should live before expiring, in milliseconds
|
|
13
|
+
* @param maxItems Amount of items that can be held in the cache maximum.
|
|
14
|
+
*/
|
|
15
|
+
constructor(timeToLive, maxItems) {
|
|
16
|
+
this.timeToLive = timeToLive;
|
|
17
|
+
this.maxItems = maxItems;
|
|
18
|
+
this.entries = {};
|
|
19
|
+
this.outstandingFetches = new Map();
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Cache cleanup routine run whenever a value is stored in the cache
|
|
23
|
+
*/
|
|
24
|
+
sliceCleanup() {
|
|
25
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
let keys = Object.keys(this.entries);
|
|
27
|
+
if (keys.length < this.maxItems)
|
|
28
|
+
return;
|
|
29
|
+
setTimeout(() => {
|
|
30
|
+
// Refresh the current count, and trim the
|
|
31
|
+
// cache to the right size, evicting last-fetched item
|
|
32
|
+
// first.
|
|
33
|
+
keys = Object.keys(this.entries);
|
|
34
|
+
let itemCount = keys.length;
|
|
35
|
+
while (itemCount > this.maxItems) {
|
|
36
|
+
let entry = this.getOldestEntry();
|
|
37
|
+
delete this.entries[entry.key];
|
|
38
|
+
--itemCount;
|
|
39
|
+
}
|
|
40
|
+
}, 100);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
getOldestEntry() {
|
|
44
|
+
let selectedEntry = null;
|
|
45
|
+
for (let key in this.entries) {
|
|
46
|
+
let entry = this.entries[key];
|
|
47
|
+
if (!selectedEntry || selectedEntry.time > entry.time)
|
|
48
|
+
selectedEntry = entry;
|
|
49
|
+
}
|
|
50
|
+
return selectedEntry;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Insert the specified item into the cache under the given key,
|
|
54
|
+
* optionally specifying a custom time-to-live. If no time-to-live
|
|
55
|
+
* is specified, the class-wide default is used.
|
|
56
|
+
*
|
|
57
|
+
* @param key The key for the cache entry
|
|
58
|
+
* @param value The value to cache
|
|
59
|
+
* @param timeToLive How long the value should remain valid for before revalidation
|
|
60
|
+
*/
|
|
61
|
+
insertItem(key, value, timeToLive) {
|
|
62
|
+
if (timeToLive === undefined)
|
|
63
|
+
timeToLive = this.timeToLive;
|
|
64
|
+
// Compute the value
|
|
65
|
+
let now = new Date().getTime();
|
|
66
|
+
let entry = this.entries[key] = {
|
|
67
|
+
key,
|
|
68
|
+
time: now,
|
|
69
|
+
expiresAt: now + timeToLive,
|
|
70
|
+
lastFetched: now,
|
|
71
|
+
value: (0, clone_1.deepClone)(value)
|
|
72
|
+
};
|
|
73
|
+
this.sliceCleanup();
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Get the value present in the cache for the given key regardless
|
|
77
|
+
* of the cache entry's expiration status.
|
|
78
|
+
*
|
|
79
|
+
* @param key The key to get
|
|
80
|
+
*/
|
|
81
|
+
get(key) {
|
|
82
|
+
let entry = this.entries[key];
|
|
83
|
+
return entry ? (0, clone_1.deepClone)(entry.value) : undefined;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get the cache entry for the given key.
|
|
87
|
+
* @param key The key to get
|
|
88
|
+
*/
|
|
89
|
+
getEntry(key) {
|
|
90
|
+
return this.entries[key];
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Fetch a value from the cache, calling the given function to
|
|
94
|
+
* generate the value if it is not present or it is expired.
|
|
95
|
+
* The result of the function is then cached for future calls.
|
|
96
|
+
*
|
|
97
|
+
* Use `options.missStrategy` to control the revalidation behavior. The default value ("fulfill") will
|
|
98
|
+
* wait until the fetch operation completes to return a value in the case where a cache miss occurs,
|
|
99
|
+
* even if an expired cache value is present. The "stale-revalidate" option will instead return the
|
|
100
|
+
* value found in the cache even when expired, executing the fetch operation if the value is expired
|
|
101
|
+
* and saving the resulting value back into the cache for future calls.
|
|
102
|
+
*
|
|
103
|
+
* @param key The key to fetch
|
|
104
|
+
* @param fetcher A function to define the value of the key if a cache miss occurs
|
|
105
|
+
* @param options Options for doing the caching.
|
|
106
|
+
*/
|
|
107
|
+
fetch(key_1, fetcher_1) {
|
|
108
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* (key, fetcher, options = {}) {
|
|
109
|
+
let existingFetch = this.outstandingFetches.get(key);
|
|
110
|
+
if (existingFetch)
|
|
111
|
+
return yield existingFetch;
|
|
112
|
+
let entry;
|
|
113
|
+
let now = Date.now();
|
|
114
|
+
let stale = true;
|
|
115
|
+
if (key in this.entries) {
|
|
116
|
+
entry = this.entries[key];
|
|
117
|
+
stale = entry.expiresAt < now;
|
|
118
|
+
}
|
|
119
|
+
if (!options.missStrategy)
|
|
120
|
+
options.missStrategy = 'fulfill';
|
|
121
|
+
if (options.missStrategy === 'fulfill')
|
|
122
|
+
entry = stale ? undefined : entry;
|
|
123
|
+
let fetchOperation;
|
|
124
|
+
if (stale && fetcher) {
|
|
125
|
+
fetchOperation = new Promise((resolve, reject) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
126
|
+
// Fetch!
|
|
127
|
+
let value;
|
|
128
|
+
try {
|
|
129
|
+
value = yield fetcher();
|
|
130
|
+
if (value !== undefined)
|
|
131
|
+
this.insertItem(key, value, options.timeToLive);
|
|
132
|
+
resolve(value);
|
|
133
|
+
}
|
|
134
|
+
catch (e) {
|
|
135
|
+
console.error(`Failed to fetch item ${key}:`);
|
|
136
|
+
console.error(e);
|
|
137
|
+
debugger;
|
|
138
|
+
resolve(entry ? (0, clone_1.deepClone)(entry.value) : undefined);
|
|
139
|
+
}
|
|
140
|
+
}));
|
|
141
|
+
fetchOperation.finally(() => this.outstandingFetches.delete(key));
|
|
142
|
+
this.outstandingFetches.set(key, fetchOperation);
|
|
143
|
+
}
|
|
144
|
+
return entry ? (0, clone_1.deepClone)(entry.value) : yield fetchOperation;
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
exports.Cache = Cache;
|
|
149
149
|
//# sourceMappingURL=cache.js.map
|
package/dist/cache.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":";;;;AAAA,mCAAoC;AAmCpC;;GAEG;AACH,MAAa,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,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACjC,IAAI,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC;gBAE5B,OAAO,SAAS,GAAG,IAAI,CAAC,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":";;;;AAAA,mCAAoC;AAmCpC;;GAEG;AACH,MAAa,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,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@@
|
|
|
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
|