File tree 6 files changed +25
-9
lines changed
idempotency/src/persistence
6 files changed +25
-9
lines changed Original file line number Diff line number Diff line change 45
45
"import" : " ./lib/esm/fromBase64.js" ,
46
46
"require" : " ./lib/cjs/fromBase64.js"
47
47
},
48
+ "./utils/lru-cache" : {
49
+ "import" : " ./lib/esm/LRUCache.js" ,
50
+ "require" : " ./lib/cjs/LRUCache.js"
51
+ },
48
52
"./types" : {
49
53
"import" : " ./lib/esm/types/index.js" ,
50
54
"require" : " ./lib/cjs/types/index.js"
60
64
" lib/cjs/fromBase64.d.ts" ,
61
65
" lib/esm/fromBase64.d.ts"
62
66
],
67
+ "utils/lru-cache" : [
68
+ " lib/cjs/LRUCache.d.ts" ,
69
+ " lib/esm/LRUCache.d.ts"
70
+ ],
63
71
"types" : [
64
72
" lib/cjs/types/index.d.ts" ,
65
73
" lib/esm/types/index.d.ts"
88
96
"devDependencies" : {
89
97
"@aws-lambda-powertools/testing-utils" : " file:../testing"
90
98
}
91
- }
99
+ }
Original file line number Diff line number Diff line change 1
- import type { LRUCacheOptions } from '.. /types/LRUCache.js' ;
1
+ import type { LRUCacheOptions } from './types/LRUCache.js' ;
2
2
3
3
const DEFAULT_MAX_SIZE = 100 ;
4
4
const NEWER = Symbol ( 'newer' ) ;
@@ -213,7 +213,7 @@ class LRUCache<K, V> {
213
213
*/
214
214
private trackItemUse ( item : Item < K , V > ) : void {
215
215
// If the item is already the newest, we don't need to do anything
216
- if ( this . mostRecentlyUsed === item ) return ; // TODO: check this
216
+ if ( this . mostRecentlyUsed === item ) return ;
217
217
218
218
// If the item is not the newest, we need to mark it as the newest
219
219
if ( item [ NEWER ] ) {
File renamed without changes.
Original file line number Diff line number Diff line change 1
1
/**
2
2
* Test LRUCache class
3
3
*
4
- * @group unit/idempotency/persistence /lru-cache
4
+ * @group unit/commons /lru-cache
5
5
*/
6
- import { LRUCache } from '../../../ src/persistence /LRUCache.js' ;
6
+ import { LRUCache } from '../../src/LRUCache.js' ;
7
7
8
8
describe ( 'Class: LRUMap' , ( ) => {
9
9
describe ( 'Method: add' , ( ) => {
Original file line number Diff line number Diff line change 1
1
{
2
- "extends" : [" ../../typedoc.base.json" ],
3
- "entryPoints" : [" ./src/index.ts" , " ./src/types/index.ts" ],
2
+ "extends" : [
3
+ " ../../typedoc.base.json"
4
+ ],
5
+ "entryPoints" : [
6
+ " ./src/index.ts" ,
7
+ " ./src/types/index.ts" ,
8
+ " ./src/typeUtils.ts" ,
9
+ " ./src/fromBase64.ts" ,
10
+ " ./src/LRUCache.ts"
11
+ ],
4
12
"readme" : " ./README.md"
5
- }
13
+ }
Original file line number Diff line number Diff line change 1
1
import { type Hash , createHash } from 'node:crypto' ;
2
2
import type { JSONValue } from '@aws-lambda-powertools/commons/types' ;
3
+ import { LRUCache } from '@aws-lambda-powertools/commons/utils/lru-cache' ;
3
4
import { search } from '@aws-lambda-powertools/jmespath' ;
4
5
import type { JMESPathParsingOptions } from '@aws-lambda-powertools/jmespath/types' ;
5
6
import { EnvironmentVariablesService } from '../config/EnvironmentVariablesService.js' ;
@@ -15,7 +16,6 @@ import type {
15
16
BasePersistenceLayerOptions ,
16
17
} from '../types/BasePersistenceLayer.js' ;
17
18
import { IdempotencyRecord } from './IdempotencyRecord.js' ;
18
- import { LRUCache } from './LRUCache.js' ;
19
19
20
20
/**
21
21
* Base class for all persistence layers. This class provides the basic functionality for
You can’t perform that action at this time.
0 commit comments