@augment-vir/common 31.68.2 → 31.68.3

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,13 +1,13 @@
1
- import { type MaybePromise, type Values } from '@augment-vir/core';
2
- export declare function mapObject<const OriginalObject, const NewKey extends PropertyKey, const NewValue>(inputObject: OriginalObject, mapCallback: (originalKey: keyof OriginalObject, originalValue: Values<OriginalObject>, originalObject: OriginalObject) => Promise<{
1
+ import { type CompleteValues, type MaybePromise } from '@augment-vir/core';
2
+ export declare function mapObject<const OriginalObject, const NewKey extends PropertyKey, const NewValue>(inputObject: OriginalObject, mapCallback: (originalKey: keyof OriginalObject, originalValue: CompleteValues<OriginalObject>, originalObject: OriginalObject) => Promise<{
3
3
  key: NewKey;
4
4
  value: NewValue;
5
5
  } | undefined>): Promise<Record<NewKey, NewValue>>;
6
- export declare function mapObject<const OriginalObject, const NewKey extends PropertyKey, const NewValue>(inputObject: OriginalObject, mapCallback: (originalKey: keyof OriginalObject, originalValue: Values<OriginalObject>, originalObject: OriginalObject) => {
6
+ export declare function mapObject<const OriginalObject, const NewKey extends PropertyKey, const NewValue>(inputObject: OriginalObject, mapCallback: (originalKey: keyof OriginalObject, originalValue: CompleteValues<OriginalObject>, originalObject: OriginalObject) => {
7
7
  key: NewKey;
8
8
  value: NewValue;
9
9
  } | undefined): Record<NewKey, NewValue>;
10
- export declare function mapObject<const OriginalObject, const NewKey extends PropertyKey, const NewValue>(inputObject: OriginalObject, mapCallback: (originalKey: keyof OriginalObject, originalValue: Values<OriginalObject>, originalObject: OriginalObject) => MaybePromise<{
10
+ export declare function mapObject<const OriginalObject, const NewKey extends PropertyKey, const NewValue>(inputObject: OriginalObject, mapCallback: (originalKey: keyof OriginalObject, originalValue: CompleteValues<OriginalObject>, originalObject: OriginalObject) => MaybePromise<{
11
11
  key: NewKey;
12
12
  value: NewValue;
13
13
  } | undefined>): MaybePromise<Record<NewKey, NewValue>>;
@@ -1,4 +1,4 @@
1
- import { type EnumBaseType, type MaybePromise, type Values } from '@augment-vir/core';
1
+ import { type CompleteValues, type EnumBaseType, type MaybePromise } from '@augment-vir/core';
2
2
  /**
3
3
  * Creates an object that maps all values of an enum to the provided `Values` type.
4
4
  *
@@ -6,6 +6,6 @@ import { type EnumBaseType, type MaybePromise, type Values } from '@augment-vir/
6
6
  * @category Package : @augment-vir/common
7
7
  * @package [`@augment-vir/common`](https://www.npmjs.com/package/@augment-vir/common)
8
8
  */
9
- export type EnumMap<Enum extends EnumBaseType, Value> = Values<Enum> extends PropertyKey ? Record<Values<Enum>, Value> : 'ERROR: invalid enum';
10
- export declare function mapEnumToObject<const Enum extends EnumBaseType, const Value>(enumInput: Enum, callback: (enumValue: Values<Enum>) => Promise<Value>): Promise<EnumMap<Enum, Value>>;
11
- export declare function mapEnumToObject<const Enum extends EnumBaseType, const Value>(enumInput: Enum, callback: (enumValue: Values<Enum>, wholeEnum: Enum) => Value): Value extends Promise<any> ? Promise<any> extends Value ? Promise<EnumMap<Enum, Awaited<Value>>> : MaybePromise<EnumMap<Enum, Awaited<Value>>> : EnumMap<Enum, Value>;
9
+ export type EnumMap<Enum extends EnumBaseType, Value> = CompleteValues<Enum> extends PropertyKey ? Record<CompleteValues<Enum>, Value> : 'ERROR: invalid enum';
10
+ export declare function mapEnumToObject<const Enum extends EnumBaseType, const Value>(enumInput: Enum, callback: (enumValue: CompleteValues<Enum>) => Promise<Value>): Promise<EnumMap<Enum, Value>>;
11
+ export declare function mapEnumToObject<const Enum extends EnumBaseType, const Value>(enumInput: Enum, callback: (enumValue: CompleteValues<Enum>, wholeEnum: Enum) => Value): Value extends Promise<any> ? Promise<any> extends Value ? Promise<EnumMap<Enum, Awaited<Value>>> : MaybePromise<EnumMap<Enum, Awaited<Value>>> : EnumMap<Enum, Value>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@augment-vir/common",
3
- "version": "31.68.2",
3
+ "version": "31.68.3",
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.68.2",
44
- "@augment-vir/core": "^31.68.2",
43
+ "@augment-vir/assert": "^31.68.3",
44
+ "@augment-vir/core": "^31.68.3",
45
45
  "@date-vir/duration": "^8.2.0",
46
46
  "ansi-styles": "^6.2.3",
47
47
  "deepcopy-esm": "^2.1.1",