@augment-vir/common 31.69.0 → 31.70.1

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.
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Creates a function type in a single-method object so its parameter types are checked bivariant-ly
3
+ * under `--strictFunctionTypes`. Method-syntax members are bivariant; bare function-typed
4
+ * properties are contravariant. `Params` is a tuple so multiple parameters can be defined.
5
+ *
6
+ * @category Function
7
+ * @category Package : @augment-vir/common
8
+ * @package [`@augment-vir/common`](https://www.npmjs.com/package/@augment-vir/common)
9
+ */
10
+ export type BivariantFunction<Params extends ReadonlyArray<unknown>, Return> = {
11
+ callback(...params: Params): Return;
12
+ }['callback'];
@@ -0,0 +1 @@
1
+ export {};
@@ -38,7 +38,7 @@ export function copyThroughJson(input) {
38
38
  /* node:coverage ignore next 4 */
39
39
  }
40
40
  catch (error) {
41
- console.error(`Failed to JSON copy for:`, input);
41
+ console.error('Failed to JSON copy for:', input);
42
42
  throw ensureErrorAndPrependMessage(error, 'Failed JSON copy');
43
43
  }
44
44
  }
@@ -56,7 +56,7 @@ export function safeCopyThroughJson(input) {
56
56
  /* node:coverage ignore next 4 */
57
57
  }
58
58
  catch (error) {
59
- console.error(`Failed to JSON copy for:`, input);
59
+ console.error('Failed to JSON copy for:', input);
60
60
  throw ensureErrorAndPrependMessage(error, 'Failed JSON copy');
61
61
  }
62
62
  }
@@ -64,7 +64,7 @@ export class PromiseQueue extends ListenTarget {
64
64
  handleItemSettle({ rejection, resolution, }) {
65
65
  const item = this.currentlyAwaiting;
66
66
  if (!item) {
67
- throw new Error(`Cannot handle queue item settle without a currently awaited queue item.`);
67
+ throw new Error('Cannot handle queue item settle without a currently awaited queue item.');
68
68
  }
69
69
  this.queue.splice(0, 1);
70
70
  this.dispatch(new PromiseQueueUpdateEvent({
package/dist/index.d.ts CHANGED
@@ -17,6 +17,7 @@ export * from './augments/array/string-array.js';
17
17
  export * from './augments/core-exports.js';
18
18
  export * from './augments/enum/enum-value-check.js';
19
19
  export * from './augments/error/combine-errors.js';
20
+ export * from './augments/function/bivariant-function.js';
20
21
  export * from './augments/function/call-asynchronously.js';
21
22
  export * from './augments/function/debounce.js';
22
23
  export * from './augments/function/execute-count.js';
package/dist/index.js CHANGED
@@ -17,6 +17,7 @@ export * from './augments/array/string-array.js';
17
17
  export * from './augments/core-exports.js';
18
18
  export * from './augments/enum/enum-value-check.js';
19
19
  export * from './augments/error/combine-errors.js';
20
+ export * from './augments/function/bivariant-function.js';
20
21
  export * from './augments/function/call-asynchronously.js';
21
22
  export * from './augments/function/debounce.js';
22
23
  export * from './augments/function/execute-count.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@augment-vir/common",
3
- "version": "31.69.0",
3
+ "version": "31.70.1",
4
4
  "description": "A collection of augments, helpers types, functions, and classes for any JavaScript environment.",
5
5
  "keywords": [
6
6
  "augment",
@@ -40,8 +40,8 @@
40
40
  "test:web": "virmator --no-deps test web"
41
41
  },
42
42
  "dependencies": {
43
- "@augment-vir/assert": "^31.69.0",
44
- "@augment-vir/core": "^31.69.0",
43
+ "@augment-vir/assert": "^31.70.1",
44
+ "@augment-vir/core": "^31.70.1",
45
45
  "@date-vir/duration": "^8.3.2",
46
46
  "@paralleldrive/cuid2": "^3.3.0",
47
47
  "ansi-styles": "^6.2.3",