@@ -1293,7 +1293,8 @@ function snippetForQuery(content: string, terms: string[]) {
12931293 const firstHit = terms
12941294 . map ( ( term ) => lower . indexOf ( term ) )
12951295 . filter ( ( index ) => index >= 0 )
1296- . sort ( ( a , b ) => a - b ) [ 0 ] ;
1296+ . sort ( ( a , b ) => a - b )
1297+ . at ( 0 ) ;
12971298 const start = Math . max ( 0 , ( firstHit ?? 0 ) - 80 ) ;
12981299 const end = Math . min ( compact . length , start + 220 ) ;
12991300 return compact . slice ( start , end ) ;
@@ -1877,8 +1878,8 @@ This workspace was created from the AFS Web UI.
18771878 const configs = loadDemoWorkspaceConfigs ( ) ;
18781879 const config = configs [ input . workspaceId ] ?? defaultWorkspaceConfig ( ) ;
18791880 const policies = loadDemoVersioningPolicies ( ) ;
1880- if ( policies [ input . workspaceId ] ) {
1881- config . versioning = policies [ input . workspaceId ] ;
1881+ if ( Object . hasOwn ( policies , input . workspaceId ) ) {
1882+ config . versioning = policies [ input . workspaceId ] ! ;
18821883 }
18831884 return normalizeWorkspaceConfig ( config ) ;
18841885 } ,
@@ -2555,7 +2556,7 @@ function normalizeWorkspaceConfig(input?: Partial<AFSWorkspaceConfig>): AFSWorks
25552556 embeddings : {
25562557 ...fallback . query . embeddings ,
25572558 ...( input ?. query ?. embeddings ?? { } ) ,
2558- chunkStrategy : input ?. query ?. embeddings ? .chunkStrategy || "auto" ,
2559+ chunkStrategy : input ?. query ?. embeddings . chunkStrategy || "auto" ,
25592560 } ,
25602561 } ,
25612562 } ;
0 commit comments