@aws-amplify/data-schema 1.3.3 → 1.3.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.
- package/dist/cjs/runtime/internals/APIClient.js +1 -1
- package/dist/cjs/runtime/internals/APIClient.js.map +1 -1
- package/dist/esm/runtime/client/index.d.ts +3 -1
- package/dist/esm/runtime/internals/APIClient.mjs +1 -1
- package/dist/esm/runtime/internals/APIClient.mjs.map +1 -1
- package/dist/meta/cjs.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/runtime/client/index.ts +5 -1
- package/src/runtime/internals/APIClient.ts +1 -1
package/package.json
CHANGED
|
@@ -79,11 +79,15 @@ type ReturnValue<
|
|
|
79
79
|
* This mapped type traverses the SelectionSetReturnValue result and the original FlatModel, restoring array types
|
|
80
80
|
* that were flattened in DeepPickFromPath
|
|
81
81
|
*
|
|
82
|
+
* Note: custom type field arrays are already handled correctly and don't need to be "restored", hence the `Result[K] extends Array<any>` check
|
|
83
|
+
*
|
|
82
84
|
*/
|
|
83
85
|
type RestoreArrays<Result, FlatModel> = {
|
|
84
86
|
[K in keyof Result]: K extends keyof FlatModel
|
|
85
87
|
? FlatModel[K] extends Array<any>
|
|
86
|
-
?
|
|
88
|
+
? Result[K] extends Array<any>
|
|
89
|
+
? Result[K]
|
|
90
|
+
: Array<RestoreArrays<Result[K], UnwrapArray<FlatModel[K]>>>
|
|
87
91
|
: FlatModel[K] extends Record<string, any>
|
|
88
92
|
? RestoreArrays<Result[K], FlatModel[K]>
|
|
89
93
|
: Result[K]
|