@naman_deep_singh/js-extensions 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  # @naman_deep_singh/js-extensions
3
3
 
4
- **Version:** 1.3.0
4
+ **Version:** 1.3.1
5
5
 
6
6
  Universal JavaScript prototype extensions for common development utilities. Works in both Node.js and browser environments with 50+ utility methods.
7
7
 
@@ -5,4 +5,12 @@ export interface PerformanceConfig {
5
5
  }
6
6
  export declare function setPerformanceConfig(newConfig: Partial<PerformanceConfig>): void;
7
7
  export declare function getPerformanceConfig(): PerformanceConfig;
8
+ export declare class LRUCache<K, V> {
9
+ private cache;
10
+ private maxSize;
11
+ constructor(maxSize?: number);
12
+ get(key: K): V | undefined;
13
+ set(key: K, value: V): void;
14
+ clear(): void;
15
+ }
8
16
  export declare function withCache<T>(key: string, fn: () => T): T;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LRUCache = void 0;
3
4
  exports.setPerformanceConfig = setPerformanceConfig;
4
5
  exports.getPerformanceConfig = getPerformanceConfig;
5
6
  exports.withCache = withCache;
@@ -52,6 +53,7 @@ class LRUCache {
52
53
  this.cache.clear();
53
54
  }
54
55
  }
56
+ exports.LRUCache = LRUCache;
55
57
  let cache = null;
56
58
  function getOrCreateCache() {
57
59
  if (!cache) {
@@ -5,4 +5,12 @@ export interface PerformanceConfig {
5
5
  }
6
6
  export declare function setPerformanceConfig(newConfig: Partial<PerformanceConfig>): void;
7
7
  export declare function getPerformanceConfig(): PerformanceConfig;
8
+ export declare class LRUCache<K, V> {
9
+ private cache;
10
+ private maxSize;
11
+ constructor(maxSize?: number);
12
+ get(key: K): V | undefined;
13
+ set(key: K, value: V): void;
14
+ clear(): void;
15
+ }
8
16
  export declare function withCache<T>(key: string, fn: () => T): T;
@@ -16,7 +16,7 @@ export function getPerformanceConfig() {
16
16
  return { ...config };
17
17
  }
18
18
  // Simple LRU cache for expensive operations
19
- class LRUCache {
19
+ export class LRUCache {
20
20
  constructor(maxSize = 100) {
21
21
  this.cache = new Map();
22
22
  this.maxSize = maxSize;
@@ -5,4 +5,12 @@ export interface PerformanceConfig {
5
5
  }
6
6
  export declare function setPerformanceConfig(newConfig: Partial<PerformanceConfig>): void;
7
7
  export declare function getPerformanceConfig(): PerformanceConfig;
8
+ export declare class LRUCache<K, V> {
9
+ private cache;
10
+ private maxSize;
11
+ constructor(maxSize?: number);
12
+ get(key: K): V | undefined;
13
+ set(key: K, value: V): void;
14
+ clear(): void;
15
+ }
8
16
  export declare function withCache<T>(key: string, fn: () => T): T;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naman_deep_singh/js-extensions",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Universal JavaScript prototype extensions for common development utilities",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",