You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- update jest config to match new config schema
- add new type MetadataWithSortKey to be used with the guard function hasSortKey on metadata
- make Attributes generic
- update typings for request-expression-builder
- add type Omit for convenience
* Checks if given metadata returns a sort key when calling metadata.getSortKey
12
+
*/
13
+
exportfunctionhasSortKey<T>(metadata: Metadata<T>): metadata is MetadataWithSortKey<T>{
14
+
returnmetadata.getSortKey()!==null
15
+
}
16
+
7
17
exportclassMetadata<T>{
8
18
readonlymodelOptions: ModelMetadata<T>
9
19
@@ -28,7 +38,7 @@ export class Metadata<T> {
28
38
* @returns {Array<PropertyMetadata<any>>} Returns all the properties property the @PartitionKeyUUID decorator is present, returns an empty array by default
@@ -49,16 +50,16 @@ export class BatchGetRequest {
49
50
50
51
// loop over all the keys
51
52
keys.forEach(key=>{
52
-
constidOb: Attributes={}
53
+
constidOb: Attributes<T>=<any>{}
53
54
54
55
if(isString(key)){
55
56
// got a simple primary key
56
57
constvalue=toDbOne(key)
57
58
if(value===null){
58
59
throwError('please provide an actual value for partition key')
59
60
}
60
-
// FIXME: should work without cast - because keyof T must be a string or symbol (error exists since update to 2.9.x -> check in a later version, there are some open issues)
0 commit comments