@augment-vir/common
Advanced tools
Comparing version 19.4.2 to 19.5.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.waitForCondition = exports.createDeferredPromiseWrapper = exports.wrapPromiseInTimeout = exports.PromiseTimeoutError = exports.isPromiseLike = exports.waitValue = exports.wait = void 0; | ||
exports.waitForCondition = exports.callAsynchronously = exports.createDeferredPromiseWrapper = exports.wrapPromiseInTimeout = exports.PromiseTimeoutError = exports.isPromiseLike = exports.waitValue = exports.wait = void 0; | ||
const error_1 = require("./error"); | ||
@@ -87,2 +87,10 @@ const typed_has_property_1 = require("./object/typed-has-property"); | ||
exports.createDeferredPromiseWrapper = createDeferredPromiseWrapper; | ||
/** | ||
* Call a function asynchronously without interrupting current synchronous execution, even if the | ||
* function was originally synchronous. | ||
*/ | ||
async function callAsynchronously(callback) { | ||
return await Promise.resolve().then(() => callback()); | ||
} | ||
exports.callAsynchronously = callAsynchronously; | ||
async function waitForCondition({ conditionCallback, timeoutMs = 10000, intervalMs = 100, timeoutMessage = '', }) { | ||
@@ -89,0 +97,0 @@ let condition = false; |
@@ -40,2 +40,3 @@ "use strict"; | ||
__exportStar(require("./augments/object/object-entries"), exports); | ||
__exportStar(require("./augments/object/old-union-to-intersection"), exports); | ||
__exportStar(require("./augments/object/pick-deep"), exports); | ||
@@ -42,0 +43,0 @@ __exportStar(require("./augments/object/typed-has-property"), exports); |
@@ -78,2 +78,9 @@ import { extractErrorMessage } from './error'; | ||
} | ||
/** | ||
* Call a function asynchronously without interrupting current synchronous execution, even if the | ||
* function was originally synchronous. | ||
*/ | ||
export async function callAsynchronously(callback) { | ||
return await Promise.resolve().then(() => callback()); | ||
} | ||
export async function waitForCondition({ conditionCallback, timeoutMs = 10000, intervalMs = 100, timeoutMessage = '', }) { | ||
@@ -80,0 +87,0 @@ let condition = false; |
@@ -24,2 +24,3 @@ export * from './augments/ansi'; | ||
export * from './augments/object/object-entries'; | ||
export * from './augments/object/old-union-to-intersection'; | ||
export * from './augments/object/pick-deep'; | ||
@@ -26,0 +27,0 @@ export * from './augments/object/typed-has-property'; |
@@ -1,3 +0,3 @@ | ||
import { UnionToIntersection } from 'type-fest'; | ||
import { PropertyValueType } from './object'; | ||
import { UnionToIntersection } from './old-union-to-intersection'; | ||
export type NestedSequentialKeys<ObjectGeneric extends object> = PropertyValueType<{ | ||
@@ -4,0 +4,0 @@ [Prop in keyof ObjectGeneric]: NonNullable<ObjectGeneric[Prop]> extends object ? Readonly<[Prop, ...(NestedSequentialKeys<NonNullable<ObjectGeneric[Prop]>> | [])]> : Readonly<[Prop]>; |
@@ -26,2 +26,7 @@ export declare function wait(delayMs: number): Promise<void>; | ||
}; | ||
/** | ||
* Call a function asynchronously without interrupting current synchronous execution, even if the | ||
* function was originally synchronous. | ||
*/ | ||
export declare function callAsynchronously<T>(callback: () => MaybePromise<T>): Promise<T>; | ||
export declare function waitForCondition({ conditionCallback, timeoutMs, intervalMs, timeoutMessage, }: WaitForConditionInputs): Promise<void>; |
@@ -24,2 +24,3 @@ export * from './augments/ansi'; | ||
export * from './augments/object/object-entries'; | ||
export * from './augments/object/old-union-to-intersection'; | ||
export * from './augments/object/pick-deep'; | ||
@@ -26,0 +27,0 @@ export * from './augments/object/typed-has-property'; |
{ | ||
"name": "@augment-vir/common", | ||
"version": "19.4.2", | ||
"version": "19.5.0", | ||
"homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/common", | ||
@@ -27,3 +27,3 @@ "bugs": { | ||
"dependencies": { | ||
"type-fest": "^4.3.3" | ||
"type-fest": "^4.4.0" | ||
}, | ||
@@ -30,0 +30,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
156697
119
3781
Updatedtype-fest@^4.4.0