@moicky/dynamodb 3.0.4 → 3.0.5

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.
@@ -51,10 +51,6 @@ export type TypedParams<T extends DynamoDBItem, ValueType, ParamType = ValueType
51
51
  export type NestedParams<T = any> = Record<`${string}.${string}`, T>;
52
52
  export type NestedTypedParams<T extends DynamoDBItem, ValueType, ParamType = ValueType> = TypedParams<T, ValueType, ParamType> & NestedParams<ParamType>;
53
53
  type Prev = [never, 0, 1, 2, 3];
54
- type PathEntry = {
55
- path: string;
56
- type: any;
57
- };
58
54
  type DeepNumberPathEntries<T, Prefix extends string = "", D extends number = 3> = [D] extends [never] ? never : {
59
55
  [K in keyof T & string]-?: NonNullable<T[K]> extends number ? {
60
56
  path: `${Prefix}${K}`;
@@ -62,7 +58,11 @@ type DeepNumberPathEntries<T, Prefix extends string = "", D extends number = 3>
62
58
  } : NonNullable<T[K]> extends any[] | Set<any> | Date | Function | Uint8Array ? never : NonNullable<T[K]> extends object ? DeepNumberPathEntries<NonNullable<T[K]>, `${Prefix}${K}.`, Prev[D]> : never;
63
59
  }[keyof T & string];
64
60
  export type StrictDeepNumberUpdates<T> = {
65
- [Entry in DeepNumberPathEntries<T> & PathEntry as Entry["path"]]?: Entry["type"];
61
+ [E in DeepNumberPathEntries<T> as E extends {
62
+ path: string;
63
+ } ? E["path"] : never]?: E extends {
64
+ type: infer V;
65
+ } ? V : never;
66
66
  };
67
67
  type DeepSetPathEntries<T, Prefix extends string = "", D extends number = 3> = [
68
68
  D
@@ -73,6 +73,10 @@ type DeepSetPathEntries<T, Prefix extends string = "", D extends number = 3> = [
73
73
  } : NonNullable<T[K]> extends Date | Function | Uint8Array ? never : NonNullable<T[K]> extends object ? DeepSetPathEntries<NonNullable<T[K]>, `${Prefix}${K}.`, Prev[D]> : never;
74
74
  }[keyof T & string];
75
75
  export type DeepSetUpdates<T> = {
76
- [Entry in DeepSetPathEntries<T> & PathEntry as Entry["path"]]?: Entry["type"][] | Set<Entry["type"]>;
76
+ [E in DeepSetPathEntries<T> as E extends {
77
+ path: string;
78
+ } ? E["path"] : never]?: E extends {
79
+ type: infer V;
80
+ } ? V[] | Set<V> : never;
77
81
  };
78
82
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moicky/dynamodb",
3
- "version": "3.0.4",
3
+ "version": "3.0.5",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "description": "Contains a collection of convenience functions for working with AWS DynamoDB",