limited-cache 2.1.0 → 2.2.0
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/CHANGELOG.md +17 -4
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/dist/{index.cjs → cjs/index.cjs} +22 -7
- package/dist/cjs/index.d.cts +92 -0
- package/dist/{core → esm/core}/LimitedCache.d.ts +1 -1
- package/dist/esm/core/LimitedCache.d.ts.map +1 -0
- package/dist/{core → esm/core}/LimitedCache.js +1 -1
- package/dist/esm/core/LimitedCache.js.map +1 -0
- package/dist/{core → esm/core}/LimitedCacheObject.d.ts +1 -1
- package/dist/esm/core/LimitedCacheObject.d.ts.map +1 -0
- package/dist/{core → esm/core}/LimitedCacheObject.js +2 -2
- package/dist/esm/core/LimitedCacheObject.js.map +1 -0
- package/dist/esm/core/builtIns.d.ts.map +1 -0
- package/dist/esm/core/builtIns.js.map +1 -0
- package/dist/{core → esm/core}/defaultOptions.d.ts +1 -1
- package/dist/esm/core/defaultOptions.d.ts.map +1 -0
- package/dist/esm/core/defaultOptions.js.map +1 -0
- package/dist/esm/core/limitedCacheUtil.d.ts +13 -0
- package/dist/esm/core/limitedCacheUtil.d.ts.map +1 -0
- package/dist/{core → esm/core}/limitedCacheUtil.js +1 -1
- package/dist/esm/core/limitedCacheUtil.js.map +1 -0
- package/dist/{core → esm/core}/lowLevelFunctions.d.ts +1 -1
- package/dist/esm/core/lowLevelFunctions.d.ts.map +1 -0
- package/dist/{core → esm/core}/lowLevelFunctions.js +2 -2
- package/dist/esm/core/lowLevelFunctions.js.map +1 -0
- package/dist/esm/index.d.ts +7 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js.map +1 -0
- package/legacy-types/ts3.5/dist/esm/core/LimitedCache.d.ts +4 -0
- package/legacy-types/ts3.5/dist/esm/core/LimitedCacheObject.d.ts +5 -0
- package/legacy-types/ts3.5/dist/esm/core/builtIns.d.ts +12 -0
- package/legacy-types/ts3.5/dist/esm/core/defaultOptions.d.ts +6 -0
- package/legacy-types/ts3.5/dist/esm/core/limitedCacheUtil.d.ts +13 -0
- package/legacy-types/ts3.5/dist/esm/core/lowLevelFunctions.d.ts +14 -0
- package/legacy-types/ts3.5/dist/esm/index.d.ts +7 -0
- package/legacy-types/ts3.5/dist/esm/types.d.ts +61 -0
- package/legacy-types/ts4.0/dist/esm/core/LimitedCache.d.ts +4 -0
- package/legacy-types/ts4.0/dist/esm/core/LimitedCacheObject.d.ts +5 -0
- package/legacy-types/ts4.0/dist/esm/core/builtIns.d.ts +12 -0
- package/legacy-types/ts4.0/dist/esm/core/defaultOptions.d.ts +6 -0
- package/legacy-types/ts4.0/dist/esm/core/limitedCacheUtil.d.ts +13 -0
- package/legacy-types/ts4.0/dist/esm/core/lowLevelFunctions.d.ts +14 -0
- package/legacy-types/ts4.0/dist/esm/index.d.ts +7 -0
- package/legacy-types/ts4.0/dist/esm/types.d.ts +61 -0
- package/legacy-types/ts4.5/dist/esm/core/LimitedCache.d.ts +4 -0
- package/legacy-types/ts4.5/dist/esm/core/LimitedCacheObject.d.ts +5 -0
- package/legacy-types/ts4.5/dist/esm/core/builtIns.d.ts +12 -0
- package/legacy-types/ts4.5/dist/esm/core/defaultOptions.d.ts +6 -0
- package/legacy-types/ts4.5/dist/esm/core/limitedCacheUtil.d.ts +13 -0
- package/legacy-types/ts4.5/dist/esm/core/lowLevelFunctions.d.ts +14 -0
- package/legacy-types/ts4.5/dist/esm/index.d.ts +7 -0
- package/legacy-types/ts4.5/dist/esm/types.d.ts +61 -0
- package/package.json +40 -38
- package/src/__tests__/LimitedCache.test.ts +3 -3
- package/src/__tests__/LimitedCacheObject.test.ts +3 -3
- package/src/__tests__/lowLevelFunctions.test.ts +3 -3
- package/src/__tests__/scenarios/keys.test.ts +1 -1
- package/src/__tests__/scenarios/maxCacheSize.test.ts +1 -1
- package/src/__tests__/scenarios/maxCacheTime.test.ts +1 -1
- package/src/__tests__/scenarios/values.test.ts +1 -1
- package/src/__tests__/typeChecks/LimitedCacheObjectTypes.test.ts +1 -1
- package/src/__tests__/typeChecks/LimitedCacheTypes.test.ts +1 -1
- package/src/__tests__/typeChecks/lowLevelFunctionsTypes.test.ts +1 -1
- package/src/core/LimitedCache.ts +2 -2
- package/src/core/LimitedCacheObject.ts +3 -3
- package/src/core/defaultOptions.ts +1 -1
- package/src/core/limitedCacheUtil.ts +1 -1
- package/src/core/lowLevelFunctions.ts +3 -3
- package/src/index.ts +6 -6
- package/dist/core/LimitedCache.d.ts.map +0 -1
- package/dist/core/LimitedCache.js.map +0 -1
- package/dist/core/LimitedCacheObject.d.ts.map +0 -1
- package/dist/core/LimitedCacheObject.js.map +0 -1
- package/dist/core/builtIns.d.ts.map +0 -1
- package/dist/core/builtIns.js.map +0 -1
- package/dist/core/defaultOptions.d.ts.map +0 -1
- package/dist/core/defaultOptions.js.map +0 -1
- package/dist/core/limitedCacheUtil.d.ts +0 -13
- package/dist/core/limitedCacheUtil.d.ts.map +0 -1
- package/dist/core/limitedCacheUtil.js.map +0 -1
- package/dist/core/lowLevelFunctions.d.ts.map +0 -1
- package/dist/core/lowLevelFunctions.js.map +0 -1
- package/dist/index.d.ts +0 -7
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -7
- package/dist/index.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- /package/dist/{core → esm/core}/builtIns.d.ts +0 -0
- /package/dist/{core → esm/core}/builtIns.js +0 -0
- /package/dist/{core → esm/core}/defaultOptions.js +0 -0
- /package/dist/{types.d.ts → esm/types.d.ts} +0 -0
- /package/dist/{types.js → esm/types.js} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './core/defaultOptions.js';
|
|
2
|
+
export * from './core/LimitedCache.js';
|
|
3
|
+
export * from './core/LimitedCacheObject.js';
|
|
4
|
+
export * from './core/limitedCacheUtil.js';
|
|
5
|
+
export * from './core/lowLevelFunctions.js';
|
|
6
|
+
export * from './types.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export type DefaultItemType = any;
|
|
2
|
+
export interface LimitedCacheOptionsFull {
|
|
3
|
+
/** Items will be removed to keep the cache within the maxCacheSize limit */
|
|
4
|
+
maxCacheSize: number;
|
|
5
|
+
/** Items will be removed and never returned if they were set more than maxCacheTime milliseconds ago */
|
|
6
|
+
maxCacheTime: number;
|
|
7
|
+
/** (dev only) A warning will be emitted if an item rotates out of the cache before this many milliseconds have passed, to indicate the size is too small */
|
|
8
|
+
warnIfItemPurgedBeforeTime: number;
|
|
9
|
+
/** (private) Internal cleanup of old keys will be performed after this many operations */
|
|
10
|
+
opLimit: number;
|
|
11
|
+
/** (private) Internal optimization to adjust how much searching will be done to find expired items, to avoid being O(n) */
|
|
12
|
+
scanLimit: number;
|
|
13
|
+
}
|
|
14
|
+
export type LimitedCacheOptions = Partial<LimitedCacheOptionsFull> | null;
|
|
15
|
+
export type LimitedCacheOptionsReadonly = Readonly<LimitedCacheOptionsFull>;
|
|
16
|
+
export interface LimitedCacheInstance<ItemType = DefaultItemType> {
|
|
17
|
+
/** Return the requested item, if it has not expired */
|
|
18
|
+
get: (cacheKey: string) => ItemType | undefined;
|
|
19
|
+
/** Return all non-expired items */
|
|
20
|
+
getAll: () => Record<string, ItemType>;
|
|
21
|
+
/** Indicate whether or not the requested item is present and has not expired */
|
|
22
|
+
has: (cacheKey: string) => boolean;
|
|
23
|
+
/** Add the item to the cache, or update its timestamp if it already exists */
|
|
24
|
+
set: (cacheKey: string, item: ItemType) => ItemType;
|
|
25
|
+
/** Remove the requested item from the cache, if necessary */
|
|
26
|
+
remove: (cacheKey: string) => true;
|
|
27
|
+
/** Remove all items and all timestamps from the cache */
|
|
28
|
+
reset: () => LimitedCacheMeta<ItemType>;
|
|
29
|
+
/** Return a serializable representation of the cache internals, suitable for long-term storage */
|
|
30
|
+
getCacheMeta: () => LimitedCacheMeta<ItemType>;
|
|
31
|
+
/** Return the cache's current values for all options */
|
|
32
|
+
getOptions: () => LimitedCacheOptionsFull;
|
|
33
|
+
/** Update one or more of the cache's options */
|
|
34
|
+
setOptions: (newOptions: LimitedCacheOptions) => LimitedCacheOptionsReadonly;
|
|
35
|
+
/** Reduces cache size by cleaning up old keys and expired items */
|
|
36
|
+
doMaintenance: () => LimitedCacheMeta<ItemType>;
|
|
37
|
+
}
|
|
38
|
+
export interface LimitedCacheObjectInstance<ItemType = DefaultItemType> {
|
|
39
|
+
[key: string]: ItemType;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A serializable representation of the cache internals, suitable for long-term storage
|
|
43
|
+
*/
|
|
44
|
+
export interface LimitedCacheMeta<ItemType = DefaultItemType> {
|
|
45
|
+
/** Schema version: old versions will be upgraded if possible, or a warning will be emitted if not */
|
|
46
|
+
limitedCacheMetaVersion: number;
|
|
47
|
+
/** Options to control cache size, time, and behavior */
|
|
48
|
+
options: LimitedCacheOptionsReadonly;
|
|
49
|
+
/** The values in the cache, stored by key. Will include old keys not yet garbage collected */
|
|
50
|
+
cache: Record<string, ItemType | undefined>;
|
|
51
|
+
/** List of keys that have been set, in chronological order. Used to find cache items most likely to be expired */
|
|
52
|
+
keyList: Array<string>;
|
|
53
|
+
/** The [setTime, expirationTime] for each key that has been set. Removed on unset. */
|
|
54
|
+
keyInfo: Record<string, [
|
|
55
|
+
number,
|
|
56
|
+
number
|
|
57
|
+
] | undefined>;
|
|
58
|
+
/** Number of operations remaining until internal cleanup of old keys is performed. Based on options.opLimit */
|
|
59
|
+
opsLeft: number;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { LimitedCacheOptions, LimitedCacheObjectInstance, LimitedCacheMeta } from '../types.js';
|
|
2
|
+
declare const LimitedCacheObject: <ItemType = any>(options?: LimitedCacheOptions) => LimitedCacheObjectInstance<ItemType>;
|
|
3
|
+
declare const getCacheMetaFromObject: (instance: LimitedCacheObjectInstance) => LimitedCacheMeta;
|
|
4
|
+
export { LimitedCacheObject, getCacheMetaFromObject };
|
|
5
|
+
//# sourceMappingURL=LimitedCacheObject.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const objectCreate: {
|
|
2
|
+
(o: object | null): any;
|
|
3
|
+
(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
|
|
4
|
+
}, objectAssign: {
|
|
5
|
+
<T extends {}, U>(target: T, source: U): T & U;
|
|
6
|
+
<T_1 extends {}, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V;
|
|
7
|
+
<T_2 extends {}, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W;
|
|
8
|
+
(target: object, ...sources: any[]): any;
|
|
9
|
+
}, hasOwnProperty: (v: PropertyKey) => boolean;
|
|
10
|
+
declare const dateNow: () => number;
|
|
11
|
+
export { objectAssign, objectCreate, dateNow, hasOwnProperty };
|
|
12
|
+
//# sourceMappingURL=builtIns.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LimitedCacheOptionsReadonly } from '../types.js';
|
|
2
|
+
declare const CURRENT_META_VERSION = 2;
|
|
3
|
+
declare const MAXIMUM_CACHE_TIME: number;
|
|
4
|
+
declare const defaultOptions: LimitedCacheOptionsReadonly;
|
|
5
|
+
export { CURRENT_META_VERSION, MAXIMUM_CACHE_TIME, defaultOptions };
|
|
6
|
+
//# sourceMappingURL=defaultOptions.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const limitedCacheUtil: {
|
|
2
|
+
init: <ItemType = any>(optionsOrCacheMeta?: import("../types.js").LimitedCacheOptions | import("../types.js").LimitedCacheMeta<ItemType> | undefined) => import("../types.js").LimitedCacheMeta<ItemType>;
|
|
3
|
+
get: <ItemType_1 = any>(cacheMeta: import("../types.js").LimitedCacheMeta<ItemType_1>, cacheKey: string) => ItemType_1 | undefined;
|
|
4
|
+
getAll: <ItemType_2 = any>(cacheMeta: import("../types.js").LimitedCacheMeta<ItemType_2>) => Record<string, ItemType_2>;
|
|
5
|
+
has: <ItemType_3 = any>(cacheMeta: import("../types.js").LimitedCacheMeta<ItemType_3>, cacheKey: string) => boolean;
|
|
6
|
+
set: <ItemType_4 = any>(cacheMeta: import("../types.js").LimitedCacheMeta<ItemType_4>, cacheKey: string, item: ItemType_4) => import("../types.js").LimitedCacheMeta<ItemType_4>;
|
|
7
|
+
remove: <ItemType_5 = any>(cacheMeta: import("../types.js").LimitedCacheMeta<ItemType_5>, cacheKey: string) => import("../types.js").LimitedCacheMeta<ItemType_5>;
|
|
8
|
+
reset: <ItemType_6 = any>(cacheMeta: import("../types.js").LimitedCacheMeta<ItemType_6>) => import("../types.js").LimitedCacheMeta<ItemType_6>;
|
|
9
|
+
doMaintenance: <ItemType_7 = any>(cacheMeta: import("../types.js").LimitedCacheMeta<ItemType_7>) => import("../types.js").LimitedCacheMeta<ItemType_7>;
|
|
10
|
+
setOptions: <ItemType_8 = any>(cacheMeta: import("../types.js").LimitedCacheMeta<ItemType_8>, options: import("../types.js").LimitedCacheOptions) => Readonly<import("../types.js").LimitedCacheOptionsFull>;
|
|
11
|
+
};
|
|
12
|
+
export { limitedCacheUtil };
|
|
13
|
+
//# sourceMappingURL=limitedCacheUtil.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LimitedCacheOptions, LimitedCacheOptionsReadonly, LimitedCacheMeta } from '../types.js';
|
|
2
|
+
declare const isCacheMeta: (cacheMeta: LimitedCacheMeta) => boolean;
|
|
3
|
+
declare const upgradeCacheMeta: (cacheMeta: LimitedCacheMeta) => void;
|
|
4
|
+
declare const lowLevelSetOptions: <ItemType = any>(cacheMeta: LimitedCacheMeta<ItemType>, options: LimitedCacheOptions) => LimitedCacheOptionsReadonly;
|
|
5
|
+
declare const lowLevelInit: <ItemType = any>(optionsOrCacheMeta?: LimitedCacheOptions | LimitedCacheMeta<ItemType> | undefined) => LimitedCacheMeta<ItemType>;
|
|
6
|
+
declare const lowLevelDoMaintenance: <ItemType = any>(cacheMeta: LimitedCacheMeta<ItemType>) => LimitedCacheMeta<ItemType>;
|
|
7
|
+
declare const lowLevelHas: <ItemType = any>(cacheMeta: LimitedCacheMeta<ItemType>, cacheKey: string) => boolean;
|
|
8
|
+
declare const lowLevelGetOne: <ItemType = any>(cacheMeta: LimitedCacheMeta<ItemType>, cacheKey: string) => ItemType | undefined;
|
|
9
|
+
declare const lowLevelGetAll: <ItemType = any>(cacheMeta: LimitedCacheMeta<ItemType>) => Record<string, ItemType>;
|
|
10
|
+
declare const lowLevelSet: <ItemType = any>(cacheMeta: LimitedCacheMeta<ItemType>, cacheKey: string, item: ItemType) => LimitedCacheMeta<ItemType>;
|
|
11
|
+
declare const lowLevelRemove: <ItemType = any>(cacheMeta: LimitedCacheMeta<ItemType>, cacheKey: string) => LimitedCacheMeta<ItemType>;
|
|
12
|
+
declare const lowLevelReset: <ItemType = any>(cacheMeta: LimitedCacheMeta<ItemType>) => LimitedCacheMeta<ItemType>;
|
|
13
|
+
export { isCacheMeta, upgradeCacheMeta, lowLevelInit, lowLevelGetOne, lowLevelGetAll, lowLevelHas, lowLevelSet, lowLevelRemove, lowLevelReset, lowLevelDoMaintenance, lowLevelSetOptions, };
|
|
14
|
+
//# sourceMappingURL=lowLevelFunctions.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './core/defaultOptions.js';
|
|
2
|
+
export * from './core/LimitedCache.js';
|
|
3
|
+
export * from './core/LimitedCacheObject.js';
|
|
4
|
+
export * from './core/limitedCacheUtil.js';
|
|
5
|
+
export * from './core/lowLevelFunctions.js';
|
|
6
|
+
export * from './types.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export type DefaultItemType = any;
|
|
2
|
+
export interface LimitedCacheOptionsFull {
|
|
3
|
+
/** Items will be removed to keep the cache within the maxCacheSize limit */
|
|
4
|
+
maxCacheSize: number;
|
|
5
|
+
/** Items will be removed and never returned if they were set more than maxCacheTime milliseconds ago */
|
|
6
|
+
maxCacheTime: number;
|
|
7
|
+
/** (dev only) A warning will be emitted if an item rotates out of the cache before this many milliseconds have passed, to indicate the size is too small */
|
|
8
|
+
warnIfItemPurgedBeforeTime: number;
|
|
9
|
+
/** (private) Internal cleanup of old keys will be performed after this many operations */
|
|
10
|
+
opLimit: number;
|
|
11
|
+
/** (private) Internal optimization to adjust how much searching will be done to find expired items, to avoid being O(n) */
|
|
12
|
+
scanLimit: number;
|
|
13
|
+
}
|
|
14
|
+
export type LimitedCacheOptions = Partial<LimitedCacheOptionsFull> | null;
|
|
15
|
+
export type LimitedCacheOptionsReadonly = Readonly<LimitedCacheOptionsFull>;
|
|
16
|
+
export interface LimitedCacheInstance<ItemType = DefaultItemType> {
|
|
17
|
+
/** Return the requested item, if it has not expired */
|
|
18
|
+
get: (cacheKey: string) => ItemType | undefined;
|
|
19
|
+
/** Return all non-expired items */
|
|
20
|
+
getAll: () => Record<string, ItemType>;
|
|
21
|
+
/** Indicate whether or not the requested item is present and has not expired */
|
|
22
|
+
has: (cacheKey: string) => boolean;
|
|
23
|
+
/** Add the item to the cache, or update its timestamp if it already exists */
|
|
24
|
+
set: (cacheKey: string, item: ItemType) => ItemType;
|
|
25
|
+
/** Remove the requested item from the cache, if necessary */
|
|
26
|
+
remove: (cacheKey: string) => true;
|
|
27
|
+
/** Remove all items and all timestamps from the cache */
|
|
28
|
+
reset: () => LimitedCacheMeta<ItemType>;
|
|
29
|
+
/** Return a serializable representation of the cache internals, suitable for long-term storage */
|
|
30
|
+
getCacheMeta: () => LimitedCacheMeta<ItemType>;
|
|
31
|
+
/** Return the cache's current values for all options */
|
|
32
|
+
getOptions: () => LimitedCacheOptionsFull;
|
|
33
|
+
/** Update one or more of the cache's options */
|
|
34
|
+
setOptions: (newOptions: LimitedCacheOptions) => LimitedCacheOptionsReadonly;
|
|
35
|
+
/** Reduces cache size by cleaning up old keys and expired items */
|
|
36
|
+
doMaintenance: () => LimitedCacheMeta<ItemType>;
|
|
37
|
+
}
|
|
38
|
+
export interface LimitedCacheObjectInstance<ItemType = DefaultItemType> {
|
|
39
|
+
[key: string]: ItemType;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A serializable representation of the cache internals, suitable for long-term storage
|
|
43
|
+
*/
|
|
44
|
+
export interface LimitedCacheMeta<ItemType = DefaultItemType> {
|
|
45
|
+
/** Schema version: old versions will be upgraded if possible, or a warning will be emitted if not */
|
|
46
|
+
limitedCacheMetaVersion: number;
|
|
47
|
+
/** Options to control cache size, time, and behavior */
|
|
48
|
+
options: LimitedCacheOptionsReadonly;
|
|
49
|
+
/** The values in the cache, stored by key. Will include old keys not yet garbage collected */
|
|
50
|
+
cache: Record<string, ItemType | undefined>;
|
|
51
|
+
/** List of keys that have been set, in chronological order. Used to find cache items most likely to be expired */
|
|
52
|
+
keyList: Array<string>;
|
|
53
|
+
/** The [setTime, expirationTime] for each key that has been set. Removed on unset. */
|
|
54
|
+
keyInfo: Record<string, [
|
|
55
|
+
number,
|
|
56
|
+
number
|
|
57
|
+
] | undefined>;
|
|
58
|
+
/** Number of operations remaining until internal cleanup of old keys is performed. Based on options.opLimit */
|
|
59
|
+
opsLeft: number;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=types.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "limited-cache",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "A minimal JS cache: like using an object, except it won't grow forever",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"limited cache",
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
"autoexpire"
|
|
15
15
|
],
|
|
16
16
|
"license": "MIT",
|
|
17
|
-
"homepage": "https://github.com/spautz/limited-cache/packages/limited-cache#readme",
|
|
17
|
+
"homepage": "https://github.com/spautz/limited-cache/tree/main/packages/limited-cache#readme",
|
|
18
18
|
"bugs": "https://github.com/spautz/limited-cache/issues",
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
21
|
-
"url": "
|
|
21
|
+
"url": "https://github.com/spautz/limited-cache.git",
|
|
22
22
|
"directory": "packages/limited-cache"
|
|
23
23
|
},
|
|
24
24
|
"author": {
|
|
@@ -42,52 +42,52 @@
|
|
|
42
42
|
"type": "module",
|
|
43
43
|
"exports": {
|
|
44
44
|
".": {
|
|
45
|
-
"import":
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
"import": {
|
|
46
|
+
"types": "./dist/esm/index.d.ts",
|
|
47
|
+
"default": "./dist/esm/index.js"
|
|
48
|
+
},
|
|
49
|
+
"require": {
|
|
50
|
+
"types": "./dist/cjs/index.d.cts",
|
|
51
|
+
"default": "./dist/cjs/index.cjs"
|
|
52
|
+
}
|
|
48
53
|
},
|
|
54
|
+
"./internal-raw-src": "./src/index.ts",
|
|
49
55
|
"./package.json": "./package.json"
|
|
50
56
|
},
|
|
51
|
-
"main": "./dist/index.cjs",
|
|
52
|
-
"module": "./dist/index.js",
|
|
53
|
-
"jsnext:main": "./dist/index.js",
|
|
54
|
-
"types": "./dist/index.d.ts",
|
|
57
|
+
"main": "./dist/cjs/index.cjs",
|
|
58
|
+
"module": "./dist/esm/index.js",
|
|
59
|
+
"jsnext:main": "./dist/esm/index.js",
|
|
60
|
+
"types": "./dist/esm/index.d.ts",
|
|
55
61
|
"sideEffects": false,
|
|
56
62
|
"dependencies": {},
|
|
57
|
-
"devDependencies": {
|
|
58
|
-
"@types/node": "18.16.3"
|
|
59
|
-
},
|
|
63
|
+
"devDependencies": {},
|
|
60
64
|
"peerDependencies": {},
|
|
61
65
|
"size-limit": [
|
|
62
66
|
{
|
|
63
|
-
"path": "dist/index.js",
|
|
67
|
+
"path": "./dist/esm/index.js",
|
|
64
68
|
"import": "{}",
|
|
65
69
|
"limit": "20 B"
|
|
66
70
|
},
|
|
67
71
|
{
|
|
68
|
-
"path": "dist/index.js",
|
|
69
|
-
"
|
|
72
|
+
"path": "./dist/esm/index.js",
|
|
73
|
+
"import": "{ LimitedCache }",
|
|
74
|
+
"limit": "1.2 kb"
|
|
70
75
|
}
|
|
71
76
|
],
|
|
72
77
|
"typesVersions": {
|
|
73
78
|
"<4.0": {
|
|
74
79
|
"*": [
|
|
75
|
-
"legacy-types/ts3.5
|
|
80
|
+
"./legacy-types/ts3.5/*"
|
|
76
81
|
]
|
|
77
82
|
},
|
|
78
83
|
"<4.5": {
|
|
79
84
|
"*": [
|
|
80
|
-
"legacy-types/ts4.0
|
|
85
|
+
"./legacy-types/ts4.0/*"
|
|
81
86
|
]
|
|
82
87
|
},
|
|
83
88
|
"<4.7": {
|
|
84
89
|
"*": [
|
|
85
|
-
"legacy-types/ts4.5
|
|
86
|
-
]
|
|
87
|
-
},
|
|
88
|
-
"*": {
|
|
89
|
-
"*": [
|
|
90
|
-
"dist/index.d.ts"
|
|
90
|
+
"./legacy-types/ts4.5/*"
|
|
91
91
|
]
|
|
92
92
|
}
|
|
93
93
|
},
|
|
@@ -95,29 +95,31 @@
|
|
|
95
95
|
"____ HOOKS _________________________________________________________": "",
|
|
96
96
|
"____ INTEGRATION ___________________________________________________": "",
|
|
97
97
|
"clean": "pnpm run build:clean && pnpm run test:clean && rimraf --glob ./node_modules/.cache *.log",
|
|
98
|
-
"all": "pnpm run
|
|
99
|
-
"all:readonly": "pnpm run
|
|
100
|
-
"all:quick": "pnpm run
|
|
101
|
-
"all:ci": "pnpm run
|
|
98
|
+
"all": "pnpm run typecheck && pnpm run lint:fix && pnpm run test:coverage && pnpm run build",
|
|
99
|
+
"all:readonly": "pnpm run typecheck && pnpm run lint && pnpm run test:quick",
|
|
100
|
+
"all:quick": "pnpm run typecheck && pnpm run lint:fix",
|
|
101
|
+
"all:ci": "pnpm run typecheck && pnpm run lint && pnpm run test:ci && pnpm pack",
|
|
102
102
|
"____ INDIVIDUAL COMMANDS ___________________________________________": "",
|
|
103
|
-
"build": "pnpm run build:
|
|
104
|
-
"build:clean": "rimraf ./dist ./legacy-types",
|
|
105
|
-
"build:
|
|
103
|
+
"build": "pnpm run build:clean && pnpm run build:cjs && pnpm run build:esm && pnpm run build:verify && pnpm run build:legacytypes",
|
|
104
|
+
"build:clean": "rimraf --glob ./dist ./legacy-types ./*.tgz",
|
|
105
|
+
"build:cjs": "tsup src/index.ts --format cjs --dts --outDir=./dist/cjs/ --tsconfig=./tsconfig.build-cjs.json",
|
|
106
|
+
"build:cjs:watch": "pnpm run build:cjs --watch",
|
|
107
|
+
"build:esm": "tsc -p tsconfig.build-esm.json",
|
|
108
|
+
"build:esm:watch": "pnpm run build:esm --watch",
|
|
106
109
|
"build:legacytypes": "pnpm run build:legacytypes:3.5 && pnpm run build:legacytypes:4.0 && pnpm run build:legacytypes:4.5",
|
|
107
|
-
"build:legacytypes:3.5": "downlevel-dts ./dist ./legacy-types/ts3.5 --to=3.5",
|
|
108
|
-
"build:legacytypes:4.0": "downlevel-dts ./dist ./legacy-types/ts4.0 --to=4.0",
|
|
109
|
-
"build:legacytypes:4.5": "downlevel-dts ./dist ./legacy-types/ts4.5 --to=4.5",
|
|
110
|
-
"build:
|
|
111
|
-
"
|
|
112
|
-
"format:verify": "prettier --list-different .",
|
|
110
|
+
"build:legacytypes:3.5": "downlevel-dts ./dist ./legacy-types/ts3.5/dist --to=3.5",
|
|
111
|
+
"build:legacytypes:4.0": "downlevel-dts ./dist ./legacy-types/ts4.0/dist --to=4.0",
|
|
112
|
+
"build:legacytypes:4.5": "downlevel-dts ./dist ./legacy-types/ts4.5/dist --to=4.5",
|
|
113
|
+
"build:verify": "publint --strict && size-limit",
|
|
114
|
+
"build:verifypack": "ls *.tgz | xargs -I {} attw {} --exclude-entrypoints internal-raw-src",
|
|
113
115
|
"lint": "eslint . --max-warnings 0",
|
|
114
116
|
"lint:fix": "eslint . --max-warnings 0 --fix",
|
|
115
|
-
"sizecheck": "size-limit",
|
|
116
117
|
"test": "pnpm run test:coverage",
|
|
117
118
|
"test:clean": "rimraf ./coverage",
|
|
118
119
|
"test:ci": "pnpm run test:clean && vitest run --coverage",
|
|
119
120
|
"test:coverage": "pnpm run test:clean && vitest run --coverage",
|
|
120
121
|
"test:quick": "pnpm run test:clean && vitest run --coverage=false",
|
|
122
|
+
"test:ui": "pnpm run test:clean && vitest --ui",
|
|
121
123
|
"test:watch": "pnpm run test:clean && vitest watch --coverage=false",
|
|
122
124
|
"test:watchcoverage": "pnpm run test:clean && vitest watch --coverage",
|
|
123
125
|
"typecheck": "tsc -p ./tsconfig.json --noEmit"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, beforeEach, expect, it } from 'vitest';
|
|
2
|
-
import { defaultOptions } from '../core/defaultOptions';
|
|
3
|
-
import { LimitedCache } from '../core/LimitedCache';
|
|
4
|
-
import { LimitedCacheInstance } from '../types';
|
|
2
|
+
import { defaultOptions } from '../core/defaultOptions.js';
|
|
3
|
+
import { LimitedCache } from '../core/LimitedCache.js';
|
|
4
|
+
import { LimitedCacheInstance } from '../types.js';
|
|
5
5
|
|
|
6
6
|
describe('LimitedCache', () => {
|
|
7
7
|
it('initializes without options', () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, beforeEach, expect, it } from 'vitest';
|
|
2
|
-
import { defaultOptions } from '../core/defaultOptions';
|
|
3
|
-
import { LimitedCacheObject, getCacheMetaFromObject } from '../core/LimitedCacheObject';
|
|
4
|
-
import { LimitedCacheObjectInstance } from '../types';
|
|
2
|
+
import { defaultOptions } from '../core/defaultOptions.js';
|
|
3
|
+
import { LimitedCacheObject, getCacheMetaFromObject } from '../core/LimitedCacheObject.js';
|
|
4
|
+
import { LimitedCacheObjectInstance } from '../types.js';
|
|
5
5
|
|
|
6
6
|
describe('LimitedCacheObject', () => {
|
|
7
7
|
it('initializes without options', () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, beforeEach, expect, it, vitest } from 'vitest';
|
|
2
|
-
import { defaultOptions } from '../core/defaultOptions';
|
|
2
|
+
import { defaultOptions } from '../core/defaultOptions.js';
|
|
3
3
|
import {
|
|
4
4
|
isCacheMeta,
|
|
5
5
|
upgradeCacheMeta,
|
|
@@ -10,8 +10,8 @@ import {
|
|
|
10
10
|
lowLevelSet,
|
|
11
11
|
lowLevelRemove,
|
|
12
12
|
lowLevelReset,
|
|
13
|
-
} from '../core/lowLevelFunctions';
|
|
14
|
-
import { LimitedCacheMeta } from '../types';
|
|
13
|
+
} from '../core/lowLevelFunctions.js';
|
|
14
|
+
import { LimitedCacheMeta } from '../types.js';
|
|
15
15
|
|
|
16
16
|
describe('lowLevelFunctions', () => {
|
|
17
17
|
describe('isCacheMeta', () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, beforeEach, expect, it, vitest } from 'vitest';
|
|
2
|
-
import { LimitedCache, LimitedCacheInstance } from '../../index';
|
|
2
|
+
import { LimitedCache, LimitedCacheInstance } from '../../index.js';
|
|
3
3
|
|
|
4
4
|
// To avoid race conditions or timing issues, since some expect() checks can take 10+ ms when busy,
|
|
5
5
|
// we use a long cache timeout even for 'immediate' expiration, and use delays slightly longer than that
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, beforeEach, expect, it, vitest } from 'vitest';
|
|
2
|
-
import { LimitedCacheObject, LimitedCacheObjectInstance } from '../../index';
|
|
2
|
+
import { LimitedCacheObject, LimitedCacheObjectInstance } from '../../index.js';
|
|
3
3
|
|
|
4
4
|
// To avoid race conditions or timing issues, since some expect() checks can take 10+ ms when busy,
|
|
5
5
|
// we use a long cache timeout even for 'immediate' expiration, and use delays slightly longer than that
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, beforeEach, expect, it } from 'vitest';
|
|
2
|
-
import { limitedCacheUtil, LimitedCacheMeta } from '../../index';
|
|
2
|
+
import { limitedCacheUtil, LimitedCacheMeta } from '../../index.js';
|
|
3
3
|
|
|
4
4
|
describe('value types', () => {
|
|
5
5
|
let myCacheMeta: LimitedCacheMeta;
|
package/src/core/LimitedCache.ts
CHANGED
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
lowLevelReset,
|
|
9
9
|
lowLevelSetOptions,
|
|
10
10
|
lowLevelDoMaintenance,
|
|
11
|
-
} from './lowLevelFunctions';
|
|
11
|
+
} from './lowLevelFunctions.js';
|
|
12
12
|
import {
|
|
13
13
|
LimitedCacheOptions,
|
|
14
14
|
LimitedCacheOptionsReadonly,
|
|
15
15
|
LimitedCacheInstance,
|
|
16
16
|
LimitedCacheMeta,
|
|
17
17
|
DefaultItemType,
|
|
18
|
-
} from '../types';
|
|
18
|
+
} from '../types.js';
|
|
19
19
|
|
|
20
20
|
// Most public functions just call a low-level function directly, passing the cacheMeta.
|
|
21
21
|
// Doing this via a helper function makes the typeChecks easier, and minifies better.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { hasOwnProperty } from './builtIns';
|
|
1
|
+
import { hasOwnProperty } from './builtIns.js';
|
|
2
2
|
import {
|
|
3
3
|
lowLevelInit,
|
|
4
4
|
lowLevelGetOne,
|
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
lowLevelHas,
|
|
7
7
|
lowLevelSet,
|
|
8
8
|
lowLevelRemove,
|
|
9
|
-
} from './lowLevelFunctions';
|
|
9
|
+
} from './lowLevelFunctions.js';
|
|
10
10
|
import {
|
|
11
11
|
LimitedCacheOptions,
|
|
12
12
|
LimitedCacheObjectInstance,
|
|
13
13
|
LimitedCacheMeta,
|
|
14
14
|
DefaultItemType,
|
|
15
|
-
} from '../types';
|
|
15
|
+
} from '../types.js';
|
|
16
16
|
|
|
17
17
|
// The `any` here doesn't escape out anywhere: it's overridden by the constructor below
|
|
18
18
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { objectAssign, objectCreate, dateNow, hasOwnProperty } from './builtIns';
|
|
2
|
-
import { CURRENT_META_VERSION, MAXIMUM_CACHE_TIME, defaultOptions } from './defaultOptions';
|
|
1
|
+
import { objectAssign, objectCreate, dateNow, hasOwnProperty } from './builtIns.js';
|
|
2
|
+
import { CURRENT_META_VERSION, MAXIMUM_CACHE_TIME, defaultOptions } from './defaultOptions.js';
|
|
3
3
|
import {
|
|
4
4
|
LimitedCacheOptions,
|
|
5
5
|
LimitedCacheOptionsReadonly,
|
|
6
6
|
LimitedCacheMeta,
|
|
7
7
|
LimitedCacheOptionsFull,
|
|
8
8
|
DefaultItemType,
|
|
9
|
-
} from '../types';
|
|
9
|
+
} from '../types.js';
|
|
10
10
|
|
|
11
11
|
/* Initialization and options */
|
|
12
12
|
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from './core/defaultOptions';
|
|
2
|
-
export * from './core/LimitedCache';
|
|
3
|
-
export * from './core/LimitedCacheObject';
|
|
4
|
-
export * from './core/limitedCacheUtil';
|
|
1
|
+
export * from './core/defaultOptions.js';
|
|
2
|
+
export * from './core/LimitedCache.js';
|
|
3
|
+
export * from './core/LimitedCacheObject.js';
|
|
4
|
+
export * from './core/limitedCacheUtil.js';
|
|
5
5
|
|
|
6
|
-
export * from './core/lowLevelFunctions';
|
|
7
|
-
export * from './types';
|
|
6
|
+
export * from './core/lowLevelFunctions.js';
|
|
7
|
+
export * from './types.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LimitedCache.d.ts","sourceRoot":"","sources":["../../src/core/LimitedCache.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,mBAAmB,EAEnB,oBAAoB,EAGrB,MAAM,UAAU,CAAC;AAUlB,QAAA,MAAM,YAAY,6BACN,mBAAmB,mCAsB9B,CAAC;AAEF,OAAO,EAAE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Aa,EAAE,uBAAuB,CAAW,qBAAqB,EAAE,SAAS,CAAC;KACnF,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LimitedCacheObject.d.ts","sourceRoot":"","sources":["../../src/core/LimitedCacheObject.ts"],"names":[],"mappings":"AASA,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,gBAAgB,EAEjB,MAAM,UAAU,CAAC;AA4ClB,QAAA,MAAM,kBAAkB,6BACZ,mBAAmB,yCAO9B,CAAC;AAEF,QAAA,MAAM,sBAAsB,aAAc,0BAA0B,KAAG,gBAEtE,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LimitedCacheObject.js","sourceRoot":"","sources":["../../src/core/LimitedCacheObject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,WAAW,EACX,WAAW,EACX,cAAc,GACf,MAAM,qBAAqB,CAAC;AAQ7B,uFAAuF;AACvF,8DAA8D;AAC9D,MAAM,YAAY,GAAkD;IAClE,GAAG,EAAE,CAAC,SAA2B,EAAE,QAAgB,EAAE,EAAE;QACrD,IAAI,QAAQ,KAAK,gBAAgB,EAAE;YACjC,OAAO,cAAc,CAAC;SACvB;QACD,OAAO,cAAc,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;IACD,wBAAwB,EAAE,CAAC,SAA2B,EAAE,QAAgB,EAAE,EAAE;QAC1E,MAAM,SAAS,GAAG,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QACnD,MAAM,SAAS,GAAG,cAAc,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAEtD,IAAI,SAAS,EAAE;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builtIns.ts"],"names":[],"mappings":"AACA,QAAA,MACU,YAAY;;;GACZ,YAAY;;;;;GACP,cAAc,6BACnB,CAAC;AACX,QAAA,MAAM,OAAO,cAAW,CAAC;AAEzB,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"builtIns.js","sourceRoot":"","sources":["../../src/core/builtIns.ts"],"names":[],"mappings":"AAAA,uBAAuB;AACvB,MAAM,EACJ,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,EAAE,cAAc,EAAE,GAC9B,GAAG,MAAM,CAAC;AACX,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC;AAEzB,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaultOptions.d.ts","sourceRoot":"","sources":["../../src/core/defaultOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAEvD,QAAA,MAAM,oBAAoB,IAAI,CAAC;AAC/B,QAAA,MAAM,kBAAkB,QAAqB,CAAC;AAE9C,QAAA,MAAM,cAAc,EAAE,2BASrB,CAAC;AAEF,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaultOptions.js","sourceRoot":"","sources":["../../src/core/defaultOptions.ts"],"names":[],"mappings":"AAEA,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAC/B,MAAM,kBAAkB,GAAG,GAAG,GAAG,KAAK,GAAG,IAAI,CAAC;AAE9C,MAAM,cAAc,GAAgC;IAClD,SAAS;IACT,YAAY,EAAE,GAAG;IACjB,YAAY,EAAE,KAAK,GAAG,IAAI;IAC1B,mBAAmB;IACnB,0BAA0B,EAAE,IAAI;IAChC,UAAU;IACV,OAAO,EAAE,GAAG;IACZ,SAAS,EAAE,EAAE;CACd,CAAC;AAEF,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
declare const limitedCacheUtil: {
|
|
2
|
-
init: <ItemType = any>(optionsOrCacheMeta?: import("..").LimitedCacheOptions | import("..").LimitedCacheMeta<ItemType> | undefined) => import("..").LimitedCacheMeta<ItemType>;
|
|
3
|
-
get: <ItemType_1 = any>(cacheMeta: import("..").LimitedCacheMeta<ItemType_1>, cacheKey: string) => ItemType_1 | undefined;
|
|
4
|
-
getAll: <ItemType_2 = any>(cacheMeta: import("..").LimitedCacheMeta<ItemType_2>) => Record<string, ItemType_2>;
|
|
5
|
-
has: <ItemType_3 = any>(cacheMeta: import("..").LimitedCacheMeta<ItemType_3>, cacheKey: string) => boolean;
|
|
6
|
-
set: <ItemType_4 = any>(cacheMeta: import("..").LimitedCacheMeta<ItemType_4>, cacheKey: string, item: ItemType_4) => import("..").LimitedCacheMeta<ItemType_4>;
|
|
7
|
-
remove: <ItemType_5 = any>(cacheMeta: import("..").LimitedCacheMeta<ItemType_5>, cacheKey: string) => import("..").LimitedCacheMeta<ItemType_5>;
|
|
8
|
-
reset: <ItemType_6 = any>(cacheMeta: import("..").LimitedCacheMeta<ItemType_6>) => import("..").LimitedCacheMeta<ItemType_6>;
|
|
9
|
-
doMaintenance: <ItemType_7 = any>(cacheMeta: import("..").LimitedCacheMeta<ItemType_7>) => import("..").LimitedCacheMeta<ItemType_7>;
|
|
10
|
-
setOptions: <ItemType_8 = any>(cacheMeta: import("..").LimitedCacheMeta<ItemType_8>, options: import("..").LimitedCacheOptions) => Readonly<import("..").LimitedCacheOptionsFull>;
|
|
11
|
-
};
|
|
12
|
-
export { limitedCacheUtil };
|
|
13
|
-
//# sourceMappingURL=limitedCacheUtil.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"limitedCacheUtil.d.ts","sourceRoot":"","sources":["../../src/core/limitedCacheUtil.ts"],"names":[],"mappings":"AAYA,QAAA,MAAM,gBAAgB;;;;;;;;;;CAUrB,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"limitedCacheUtil.js","sourceRoot":"","sources":["../../src/core/limitedCacheUtil.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,cAAc,EACd,WAAW,EACX,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,aAAa,EACb,WAAW,EACX,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,gBAAgB,GAAG;IACvB,IAAI,EAAE,YAAY;IAClB,GAAG,EAAE,cAAc;IACnB,MAAM,EAAE,cAAc;IACtB,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,WAAW;IAChB,MAAM,EAAE,cAAc;IACtB,KAAK,EAAE,aAAa;IACpB,aAAa,EAAE,qBAAqB;IACpC,UAAU,EAAE,kBAAkB;CAC/B,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lowLevelFunctions.d.ts","sourceRoot":"","sources":["../../src/core/lowLevelFunctions.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EACnB,2BAA2B,EAC3B,gBAAgB,EAGjB,MAAM,UAAU,CAAC;AAqBlB,QAAA,MAAM,WAAW,cAAe,gBAAgB,KAAG,OAElD,CAAC;AAEF,QAAA,MAAM,gBAAgB,cAAe,gBAAgB,KAAG,IAWvD,CAAC;AAEF,QAAA,MAAM,kBAAkB,mEAEb,mBAAmB,KAC3B,2BAGF,CAAC;AAEF,QAAA,MAAM,YAAY,mIAkBjB,CAAC;AA0BF,QAAA,MAAM,qBAAqB,uFA+B1B,CA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