Socket
Socket
Sign inDemoInstall

haystack-core

Package Overview
Dependencies
Maintainers
13
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

haystack-core - npm Package Compare versions

Comparing version 2.0.30 to 2.0.31

109

dist/util/memoize.d.ts
/**
* 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;

2

package.json

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc