bruce-models 2.0.6 → 2.0.7

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.
@@ -5873,6 +5873,28 @@
5873
5873
  UTC.FromDate = FromDate;
5874
5874
  })(exports.UTC || (exports.UTC = {}));
5875
5875
 
5876
+ class LRUCache {
5877
+ constructor(capacity) {
5878
+ this.capacity = capacity;
5879
+ this.cache = new Map();
5880
+ }
5881
+ Get(key) {
5882
+ const value = this.cache.get(key);
5883
+ if (value) {
5884
+ this.cache.delete(key);
5885
+ this.cache.set(key, value);
5886
+ }
5887
+ return value;
5888
+ }
5889
+ Set(key, value) {
5890
+ if (this.cache.size >= this.capacity) {
5891
+ const leastRecentlyUsedKey = this.cache.keys().next().value;
5892
+ this.cache.delete(leastRecentlyUsedKey);
5893
+ }
5894
+ this.cache.set(key, value);
5895
+ }
5896
+ }
5897
+
5876
5898
  (function (EntityAttachmentType) {
5877
5899
  function GetCacheKey(id) {
5878
5900
  return exports.Api.ECacheKey.AttachmentType + exports.Api.ECacheKey.Id + id;
@@ -10584,6 +10606,7 @@
10584
10606
  exports.BruceEvent = BruceEvent;
10585
10607
  exports.CacheControl = CacheControl;
10586
10608
  exports.DelayQueue = DelayQueue;
10609
+ exports.LRUCache = LRUCache;
10587
10610
 
10588
10611
  Object.defineProperty(exports, '__esModule', { value: true });
10589
10612