@@ -178,7 +178,7 @@ export class NodeCache extends Hookified {
178178 * @param {string | number } key if the key is a number it will convert it to a string
179179 * @returns {T } the value or undefined
180180 */
181- public get < T > ( key : string | number ) : any {
181+ public get < T > ( key : string | number ) : T | undefined {
182182 const result = this . store . get ( this . formatKey ( key ) ) ;
183183 if ( result ) {
184184 if ( result . ttl > 0 ) {
@@ -195,15 +195,15 @@ export class NodeCache extends Hookified {
195195
196196 this . _stats . incrementHits ( ) ;
197197 if ( this . options . useClones ) {
198- return this . _cacheable . clone ( result . value ) ;
198+ return this . _cacheable . clone ( result . value ) as T ;
199199 }
200200
201201 return result . value as T ;
202202 }
203203
204204 this . _stats . incrementHits ( ) ;
205205 if ( this . options . useClones ) {
206- return this . _cacheable . clone ( result . value ) ;
206+ return this . _cacheable . clone ( result . value ) as T ;
207207 }
208208
209209 return result . value as T ;
@@ -217,10 +217,10 @@ export class NodeCache extends Hookified {
217217 * Gets multiple saved values from the cache. Returns an empty object {} if not found or expired.
218218 * If the value was found it returns an object with the key value pair.
219219 * @param {Array<string | number } keys an array of keys
220- * @returns {Record<string, unknown > } an object with the key as a property and the value as the value
220+ * @returns {Record<string, T | undefined > } an object with the key as a property and the value as the value
221221 */
222- public mget < T > ( keys : Array < string | number > ) : Record < string , unknown > {
223- const result : Record < string , unknown > = { } ;
222+ public mget < T > ( keys : Array < string | number > ) : Record < string , T | undefined > {
223+ const result : Record < string , T | undefined > = { } ;
224224
225225 for ( const key of keys ) {
226226 const value = this . get ( key ) ;
0 commit comments