@augment-vir/common 30.1.0 → 30.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { convertDuration
|
|
1
|
+
import { convertDuration } from '@date-vir/duration';
|
|
2
2
|
/**
|
|
3
3
|
* Different types of debouncing for the {@link Debounce} class.
|
|
4
4
|
*
|
|
@@ -107,6 +107,6 @@ export class Debounce {
|
|
|
107
107
|
}, this.debounceDuration.milliseconds);
|
|
108
108
|
}
|
|
109
109
|
this.nextCallTimestamp =
|
|
110
|
-
now + convertDuration(this.debounceDuration,
|
|
110
|
+
now + convertDuration(this.debounceDuration, { milliseconds: true }).milliseconds;
|
|
111
111
|
}
|
|
112
112
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { check } from '@augment-vir/assert';
|
|
2
2
|
import { ensureError } from '@augment-vir/core';
|
|
3
|
-
import { convertDuration
|
|
3
|
+
import { convertDuration } from '@date-vir/duration';
|
|
4
4
|
/**
|
|
5
5
|
* An error thrown by {@link wrapPromiseInTimeout} when the timeout is reached.
|
|
6
6
|
*
|
|
@@ -14,7 +14,7 @@ export class PromiseTimeoutError extends Error {
|
|
|
14
14
|
constructor(duration, failureMessage) {
|
|
15
15
|
super([
|
|
16
16
|
failureMessage,
|
|
17
|
-
`Promised timed out after ${convertDuration(duration,
|
|
17
|
+
`Promised timed out after ${convertDuration(duration, { milliseconds: true }).milliseconds} ms.`,
|
|
18
18
|
]
|
|
19
19
|
.filter(check.isTruthy)
|
|
20
20
|
.join(': '));
|
|
@@ -30,7 +30,7 @@ export class PromiseTimeoutError extends Error {
|
|
|
30
30
|
* @package [`@augment-vir/common`](https://www.npmjs.com/package/@augment-vir/common)
|
|
31
31
|
*/
|
|
32
32
|
export function wrapPromiseInTimeout(duration, originalPromise, failureMessage) {
|
|
33
|
-
const milliseconds = convertDuration(duration,
|
|
33
|
+
const milliseconds = convertDuration(duration, { milliseconds: true }).milliseconds;
|
|
34
34
|
return new Promise(async (resolve, reject) => {
|
|
35
35
|
const timeoutId = milliseconds === Infinity
|
|
36
36
|
? undefined
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@augment-vir/common",
|
|
3
|
-
"version": "30.
|
|
3
|
+
"version": "30.2.0",
|
|
4
4
|
"description": "A collection of augments, helpers types, functions, and classes for any JavaScript environment.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"augment",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"test:web": "virmator --no-deps test web"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@augment-vir/assert": "^30.
|
|
43
|
-
"@augment-vir/core": "^30.
|
|
44
|
-
"@date-vir/duration": "^6.0.
|
|
42
|
+
"@augment-vir/assert": "^30.2.0",
|
|
43
|
+
"@augment-vir/core": "^30.2.0",
|
|
44
|
+
"@date-vir/duration": "^6.0.1",
|
|
45
45
|
"ansi-styles": "^6.2.1",
|
|
46
46
|
"json5": "^2.2.3",
|
|
47
47
|
"type-fest": "^4.26.1"
|