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

namirasoft-core

Package Overview
Dependencies
Maintainers
0
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

namirasoft-core - npm Package Compare versions

Comparing version 1.4.44 to 1.4.45

1

dist/CacheService.d.ts

@@ -8,2 +8,3 @@ import { IStorage } from "./IStorage";

private getFromSource;
onExpired?: () => void;
constructor(name: string, storage: IStorage, duration_minutes: number, getVersion: () => Promise<string>, getFromSource: () => Promise<DataType>);

@@ -10,0 +11,0 @@ get(): Promise<DataType>;

@@ -44,2 +44,11 @@ "use strict";

this.storage.set(this.name, value);
if (this.onExpired) {
let sleep = expires_at.getTime() - new Date().getTime();
if (sleep <= 0)
sleep = 5 * 1000;
setTimeout(() => {
var _a;
(_a = this.onExpired) === null || _a === void 0 ? void 0 : _a.call(this);
}, sleep);
}
});

@@ -46,0 +55,0 @@ }

2

package.json

@@ -11,3 +11,3 @@ {

"private": false,
"version": "1.4.44",
"version": "1.4.45",
"author": "Amir Abolhasani",

@@ -14,0 +14,0 @@ "license": "MIT",

@@ -17,3 +17,3 @@ import { IStorage } from "./IStorage";

private getFromSource: () => Promise<DataType>;
// private onExpired: () => void;
public onExpired?: () => void;
constructor(name: string, storage: IStorage, duration_minutes: number, getVersion: () => Promise<string>, getFromSource: () => Promise<DataType>)

@@ -26,3 +26,2 @@ {

this.getFromSource = getFromSource;
// this.onExpired = onExpired;
}

@@ -52,11 +51,13 @@ async get(): Promise<DataType>

this.storage.set(this.name, value);
//
// let sleep = expires_at.getTime() - new Date().getTime();
// if (sleep <= 0)
// sleep = 5 * 1000;
// setTimeout(() =>
// {
// if (this.onExpired)
// this.onExpired();
// }, sleep);
if (this.onExpired)
{
let sleep = expires_at.getTime() - new Date().getTime();
if (sleep <= 0)
sleep = 5 * 1000;
setTimeout(() =>
{
this.onExpired?.();
}, sleep);
}
}

@@ -63,0 +64,0 @@ del()

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