@@ -60,13 +60,21 @@ function searchAttributeKey<T extends SearchAttributeType>(name: string, type: T
60
60
return { name, type } ;
61
61
}
62
62
63
- export function searchAttributePair < T extends SearchAttributeType > ( name : string , type : T , value : IndexedValueTypeMapping [ T ] ) : TypedSearchAttributePair {
63
+ export function searchAttributePair < T extends SearchAttributeType > (
64
+ name : string ,
65
+ type : T ,
66
+ value : IndexedValueTypeMapping [ T ]
67
+ ) : TypedSearchAttributePair {
64
68
const key = searchAttributeKey ( name , type ) ;
65
69
const typedValue : TypedSearchAttributeValue < T > = [ type , value ] ;
66
70
return [ key , typedValue ] as TypedSearchAttributePair ;
67
71
}
68
72
69
- export function searchAttributeUpdatePair < T extends SearchAttributeType > ( name : string , type : T , value : IndexedValueTypeMapping [ T ] | null ) : TypedSearchAttributeUpdatePair {
73
+ export function searchAttributeUpdatePair < T extends SearchAttributeType > (
74
+ name : string ,
75
+ type : T ,
76
+ value : IndexedValueTypeMapping [ T ] | null
77
+ ) : TypedSearchAttributeUpdatePair {
70
78
const key = searchAttributeKey ( name , type ) ;
71
79
const typedValue : TypedSearchAttributeValue < T > | null = value === null ? value : [ type , value ] ;
72
80
return [ key , typedValue ] as TypedSearchAttributeUpdatePair ;
@@ -276,10 +284,7 @@ export class TypedSearchAttributes {
276
284
case 'string' :
277
285
return searchAttributeKey ( key , SearchAttributeType . TEXT ) ;
278
286
case 'number' :
279
- return searchAttributeKey (
280
- key ,
281
- Number . isInteger ( val ) ? SearchAttributeType . INT : SearchAttributeType . DOUBLE
282
- ) ;
287
+ return searchAttributeKey ( key , Number . isInteger ( val ) ? SearchAttributeType . INT : SearchAttributeType . DOUBLE ) ;
283
288
case 'boolean' :
284
289
return searchAttributeKey ( key , SearchAttributeType . BOOL ) ;
285
290
case 'object' :
@@ -289,6 +294,7 @@ export class TypedSearchAttributes {
289
294
if ( Array . isArray ( val ) && val . every ( ( item ) => typeof item === 'string' ) ) {
290
295
return searchAttributeKey ( key , SearchAttributeType . KEYWORD_LIST ) ;
291
296
}
297
+ return ;
292
298
default :
293
299
return ;
294
300
}
0 commit comments