haystack-core
Advanced tools
Comparing version 2.0.30 to 2.0.31
/** | ||
* Memoization Cache. | ||
*/ | ||
export declare class MemoizeCache { | ||
#private; | ||
/** | ||
* Get an item from the cache. | ||
* | ||
* ```typescript | ||
* const myAge = getMemoizeCache(obj)?.get('age') | ||
* ``` | ||
* | ||
* @param name name of item to retrieve. | ||
* @returns item or undefined. | ||
*/ | ||
get(name: string): any; | ||
/** | ||
* Set an item in the cache. | ||
* | ||
* ```typescript | ||
* getMemoizeCache(obj)?.set('age', 123) | ||
* ``` | ||
* | ||
* @param name name of cached item. | ||
* @param value cached item. | ||
* @returns The cache item. | ||
*/ | ||
set(name: string, value: any): any; | ||
/** | ||
* Return true if the item exists in the cache. | ||
* | ||
```typescript | ||
* const isInCache = !!getMemoizeCache(obj)?.has('age') | ||
* ``` | ||
* | ||
* @param name name of cached item to lookup. | ||
* @returns true if an item is in cache. | ||
*/ | ||
has(name: string): boolean; | ||
/** | ||
* Clear all entries from the cache. | ||
* | ||
* ```typescript | ||
* getMemoizeCache(obj)?.clear() | ||
* ``` | ||
*/ | ||
clear(): void; | ||
/** | ||
* Removes an item from the cache by name. | ||
* | ||
* ```typescript | ||
* getMemoizeCache(obj).delete('memoizedElementName') | ||
* ``` | ||
* | ||
* @param name cached item name to remove | ||
* @returns true if an item is successfully removed. | ||
*/ | ||
remove(name: string): boolean; | ||
/** | ||
* Return the size of the cache. | ||
* | ||
* ```typescript | ||
* const size = getMemoizeCache(obj).?size ?? 0 | ||
* ``` | ||
* | ||
* @returns The size of the cache. | ||
*/ | ||
get size(): number; | ||
/** | ||
* Returns if the cache is empty. | ||
* | ||
* @returns True if the cache is empty. | ||
*/ | ||
isEmpty(): boolean; | ||
/** | ||
* Return all of the cached keys. | ||
* | ||
* * ```typescript | ||
* const keys = getMemoizeCache(obj)?.keys() | ||
* ``` | ||
* | ||
* @returns The cache's keys. | ||
*/ | ||
get keys(): string[]; | ||
/** | ||
* Return a copy of the cache as an object. | ||
* | ||
* ```typescript | ||
* const obj = getMemoizeCache(obj)?.toObj() | ||
* ``` | ||
* | ||
* @returns The cached values. | ||
*/ | ||
toObj(): Record<string, any>; | ||
/** | ||
* Dump the value to the local console output. | ||
* | ||
* @param message An optional message to display before the value. | ||
* @returns The value instance. | ||
*/ | ||
inspect(message?: string): this; | ||
} | ||
/** | ||
* Return the memoized cache to use or undefined if it can't be found. | ||
* | ||
* @param obj The object to look up the cache from. | ||
* @returns The memoize cache or undefined if not found. | ||
*/ | ||
export declare function getMemoizeCache(obj: any): MemoizeCache | undefined; | ||
/** | ||
* A property accessor decorator used for memoization of getters and methods. | ||
*/ | ||
export declare function memoize(): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void; |
@@ -14,3 +14,3 @@ { | ||
"email": "support@j2inn.com", | ||
"version": "2.0.30", | ||
"version": "2.0.31", | ||
"module": "dist/index.es.js", | ||
@@ -17,0 +17,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1178117
38199