Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@augment-vir/common

Package Overview
Dependencies
Maintainers
1
Versions
222
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@augment-vir/common - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

7

dist/augments/promise.d.ts

@@ -17,1 +17,8 @@ export declare function wait(delayMs: number): Promise<void>;

export declare function createDeferredPromiseWrapper<T = void>(): DeferredPromiseWrapper<T>;
export declare type WaitForConditionInputs = {
conditionCallback: () => boolean | Promise<boolean>;
timeoutMs?: number;
intervalMs?: number;
timeoutMessage?: string;
};
export declare function waitForCondition({ conditionCallback, timeoutMs, intervalMs, timeoutMessage, }: WaitForConditionInputs): Promise<void>;

27

dist/augments/promise.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createDeferredPromiseWrapper = exports.wrapPromiseInTimeout = exports.PromiseTimeoutError = exports.isPromiseLike = exports.wait = void 0;
exports.waitForCondition = exports.createDeferredPromiseWrapper = exports.wrapPromiseInTimeout = exports.PromiseTimeoutError = exports.isPromiseLike = exports.wait = void 0;
const error_1 = require("./error");
const object_1 = require("./object");

@@ -69,1 +70,25 @@ function wait(delayMs) {

exports.createDeferredPromiseWrapper = createDeferredPromiseWrapper;
async function waitForCondition({ conditionCallback, timeoutMs = 10000, intervalMs = 100, timeoutMessage = '', }) {
let condition = false;
let lastError;
async function checkCondition() {
try {
condition = !!(await conditionCallback());
}
catch (error) {
condition = false;
lastError = error;
}
}
const startTime = Date.now();
await checkCondition();
while (!condition) {
await wait(intervalMs);
if (Date.now() - startTime >= timeoutMs) {
const message = timeoutMessage ? `${timeoutMessage}: ` : '';
throw new Error(`${message}Timeout of "${timeoutMs}" exceeded waiting for condition to be true${(0, error_1.extractErrorMessage)(lastError)}`);
}
await checkCondition();
}
}
exports.waitForCondition = waitForCondition;

2

package.json
{
"name": "@augment-vir/common",
"version": "4.0.0",
"version": "4.1.0",
"homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/common",

@@ -5,0 +5,0 @@ "bugs": {

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