New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@mittwald/kubernetes

Package Overview
Dependencies
Maintainers
2
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mittwald/kubernetes - npm Package Compare versions

Comparing version 3.4.0 to 3.4.1

4

cache/store.d.ts

@@ -37,4 +37,6 @@ import { MetadataObject } from "../types/meta";

private api;
private expirationSeconds;
private cache;
constructor(api: INamespacedResourceClient<R, any, any>);
constructor(api: INamespacedResourceClient<R, any, any>, expirationSeconds?: number);
private storeInMap;
store(obj: R): Promise<void>;

@@ -41,0 +43,0 @@ sync(objs: R[]): Promise<void>;

@@ -79,9 +79,20 @@ "use strict";

class CachingLookupStore {
constructor(api) {
constructor(api, expirationSeconds = 3600) {
this.api = api;
this.expirationSeconds = expirationSeconds;
this.cache = new Map();
}
storeInMap(obj, map) {
const { namespace, name } = obj.metadata;
const key = `${namespace}/${name}`;
const exp = new Date();
exp.setSeconds(exp.getSeconds() + this.expirationSeconds);
map.set(key, {
entry: obj,
until: exp,
});
}
store(obj) {
return __awaiter(this, void 0, void 0, function* () {
// no-op
this.storeInMap(obj, this.cache);
});

@@ -91,3 +102,7 @@ }

return __awaiter(this, void 0, void 0, function* () {
// no-op
const newCache = new Map();
for (const obj of objs) {
this.storeInMap(obj, newCache);
}
this.cache = newCache;
});

@@ -106,8 +121,3 @@ }

if (result) {
const exp = new Date();
exp.setSeconds(exp.getSeconds() + 3600);
this.cache.set(key, {
entry: result,
until: exp,
});
this.store(result);
}

@@ -119,3 +129,5 @@ return result;

return __awaiter(this, void 0, void 0, function* () {
// no-op
const { namespace, name } = obj.metadata;
const key = `${namespace}/${name}`;
this.cache.delete(key);
});

@@ -122,0 +134,0 @@ }

@@ -64,3 +64,3 @@ {

},
"version": "3.4.0"
"version": "3.4.1"
}

Sorry, the diff of this file is not supported yet

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