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

@peerbit/time

Package Overview
Dependencies
Maintainers
0
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@peerbit/time - npm Package Compare versions

Comparing version 2.0.7-2d408db to 2.0.7-2de0560

20

dist/src/wait.js

@@ -26,7 +26,12 @@ export class TimeoutError extends Error {

let stop = false;
let aborted = false;
const handleAbort = () => {
stop = true;
aborted = true;
options.signal?.removeEventListener("abort", handleAbort);
};
options.signal?.addEventListener("abort", handleAbort);
if (options?.signal?.aborted) {
handleAbort();
}
// eslint-disable-next-line no-unmodified-loop-condition

@@ -41,3 +46,8 @@ while (!stop && Number(new Date()) - startTime < timeout) {

}
throw createTimeoutError(options);
if (aborted) {
throw new AbortError();
}
else {
throw createTimeoutError(options);
}
};

@@ -50,7 +60,12 @@ export const waitForResolved = async (fn, options = { timeout: 10 * 1000, delayInterval: 50 }) => {

let lastError;
let aborted = false;
const handleAbort = () => {
stop = true;
aborted = true;
options.signal?.removeEventListener("abort", handleAbort);
};
options.signal?.addEventListener("abort", handleAbort);
if (options?.signal?.aborted) {
handleAbort();
}
// eslint-disable-next-line no-unmodified-loop-condition

@@ -73,4 +88,7 @@ while (!stop && Number(new Date()) - startTime < timeout) {

}
if (aborted) {
throw new AbortError();
}
throw lastError || createTimeoutError(options);
};
//# sourceMappingURL=wait.js.map

2

package.json
{
"name": "@peerbit/time",
"version": "2.0.7-2d408db",
"version": "2.0.7-2de0560",
"description": "Utility functions for time",

@@ -5,0 +5,0 @@ "type": "module",

@@ -39,4 +39,6 @@ export class TimeoutError extends Error {}

let aborted = false;
const handleAbort = () => {
stop = true;
aborted = true;
options.signal?.removeEventListener("abort", handleAbort);

@@ -46,2 +48,5 @@ };

options.signal?.addEventListener("abort", handleAbort);
if (options?.signal?.aborted) {
handleAbort();
}

@@ -58,3 +63,7 @@ // eslint-disable-next-line no-unmodified-loop-condition

}
throw createTimeoutError(options);
if (aborted) {
throw new AbortError();
} else {
throw createTimeoutError(options);
}
};

@@ -78,4 +87,6 @@

let aborted = false;
const handleAbort = () => {
stop = true;
aborted = true;
options.signal?.removeEventListener("abort", handleAbort);

@@ -85,2 +96,5 @@ };

options.signal?.addEventListener("abort", handleAbort);
if (options?.signal?.aborted) {
handleAbort();
}

@@ -103,3 +117,7 @@ // eslint-disable-next-line no-unmodified-loop-condition

if (aborted) {
throw new AbortError();
}
throw lastError || createTimeoutError(options);
};

Sorry, the diff of this file is not supported yet

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