File tree Expand file tree Collapse file tree 6 files changed +25
-9
lines changed
idempotency/src/persistence Expand file tree Collapse file tree 6 files changed +25
-9
lines changed Original file line number Diff line number Diff line change 4545 "import" : " ./lib/esm/fromBase64.js" ,
4646 "require" : " ./lib/cjs/fromBase64.js"
4747 },
48+ "./utils/lru-cache" : {
49+ "import" : " ./lib/esm/LRUCache.js" ,
50+ "require" : " ./lib/cjs/LRUCache.js"
51+ },
4852 "./types" : {
4953 "import" : " ./lib/esm/types/index.js" ,
5054 "require" : " ./lib/cjs/types/index.js"
6064 " lib/cjs/fromBase64.d.ts" ,
6165 " lib/esm/fromBase64.d.ts"
6266 ],
67+ "utils/lru-cache" : [
68+ " lib/cjs/LRUCache.d.ts" ,
69+ " lib/esm/LRUCache.d.ts"
70+ ],
6371 "types" : [
6472 " lib/cjs/types/index.d.ts" ,
6573 " lib/esm/types/index.d.ts"
8896 "devDependencies" : {
8997 "@aws-lambda-powertools/testing-utils" : " file:../testing"
9098 }
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' ;
22
33const DEFAULT_MAX_SIZE = 100 ;
44const NEWER = Symbol ( 'newer' ) ;
@@ -213,7 +213,7 @@ class LRUCache<K, V> {
213213 */
214214 private trackItemUse ( item : Item < K , V > ) : void {
215215 // 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 ;
217217
218218 // If the item is not the newest, we need to mark it as the newest
219219 if ( item [ NEWER ] ) {
File renamed without changes.
Original file line number Diff line number Diff line change 11/**
22 * Test LRUCache class
33 *
4- * @group unit/idempotency/persistence /lru-cache
4+ * @group unit/commons /lru-cache
55 */
6- import { LRUCache } from '../../../ src/persistence /LRUCache.js' ;
6+ import { LRUCache } from '../../src/LRUCache.js' ;
77
88describe ( 'Class: LRUMap' , ( ) => {
99 describe ( 'Method: add' , ( ) => {
Original file line number Diff line number Diff line change 11{
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+ ],
412 "readme" : " ./README.md"
5- }
13+ }
Original file line number Diff line number Diff line change 11import { type Hash , createHash } from 'node:crypto' ;
22import type { JSONValue } from '@aws-lambda-powertools/commons/types' ;
3+ import { LRUCache } from '@aws-lambda-powertools/commons/utils/lru-cache' ;
34import { search } from '@aws-lambda-powertools/jmespath' ;
45import type { JMESPathParsingOptions } from '@aws-lambda-powertools/jmespath/types' ;
56import { EnvironmentVariablesService } from '../config/EnvironmentVariablesService.js' ;
@@ -15,7 +16,6 @@ import type {
1516 BasePersistenceLayerOptions ,
1617} from '../types/BasePersistenceLayer.js' ;
1718import { IdempotencyRecord } from './IdempotencyRecord.js' ;
18- import { LRUCache } from './LRUCache.js' ;
1919
2020/**
2121 * 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