99 searchHits ,
1010 type SearchRecord ,
1111 type RequestSearchRecord ,
12- type FolderSearchRecord ,
12+ type FolderSearchRecord
1313} from './searchIndex' ;
1414import type { NavEntry } from '../../routing/types' ;
1515
@@ -35,7 +35,7 @@ const requestEntry = (over: Partial<NavEntry> & { uuid: string }): NavEntry => {
3535const childItem = ( name : string , type : 'http' | 'folder' | 'script' , items ?: unknown [ ] ) => ( {
3636 uuid : `${ type } -${ name } ` ,
3737 info : { name, type } ,
38- ...( items ? { items } : { } ) ,
38+ ...( items ? { items } : { } )
3939} ) ;
4040
4141const folderEntry = ( over : Partial < NavEntry > & { uuid : string ; items ?: unknown [ ] } ) : NavEntry => {
@@ -47,7 +47,7 @@ const folderEntry = (over: Partial<NavEntry> & { uuid: string; items?: unknown[]
4747 ancestors : [ ] ,
4848 depth : 0 ,
4949 item : { uuid, info : { name : 'Hotels' , type : 'folder' } , items : items ?? [ ] } as never ,
50- ...rest ,
50+ ...rest
5151 } ;
5252} ;
5353
@@ -93,7 +93,7 @@ describe('buildSearchRecords', () => {
9393 slug : 'hotels/rooms' ,
9494 name : 'Rooms' ,
9595 ancestors : [ { name : 'Hotels' , slug : 'hotels' } ] ,
96- depth : 1 ,
96+ depth : 1
9797 } ) ;
9898 const recs = folderRecords ( [ top , nested ] ) ;
9999 expect ( recs . map ( ( r ) => r . id ) ) . toEqual ( [ 'f1' , 'f2' ] ) ;
@@ -108,23 +108,23 @@ describe('buildSearchRecords', () => {
108108 name : 'Auth' ,
109109 ancestors : [
110110 { name : 'Billing' , slug : 'billing' } ,
111- { name : 'Customers' , slug : 'billing/customers' } ,
111+ { name : 'Customers' , slug : 'billing/customers' }
112112 ] ,
113- depth : 2 ,
113+ depth : 2
114114 } ) ;
115115 const productsAuth = folderEntry ( {
116116 uuid : 'f2' ,
117117 slug : 'products/users/auth' ,
118118 name : 'Auth' ,
119119 ancestors : [
120120 { name : 'Products' , slug : 'products' } ,
121- { name : 'Users' , slug : 'products/users' } ,
121+ { name : 'Users' , slug : 'products/users' }
122122 ] ,
123- depth : 2 ,
123+ depth : 2
124124 } ) ;
125125 expect ( folderRecords ( [ billingAuth , productsAuth ] ) . map ( ( r ) => r . ancestorNames ) ) . toEqual ( [
126126 [ 'Billing' , 'Customers' ] ,
127- [ 'Products' , 'Users' ] ,
127+ [ 'Products' , 'Users' ]
128128 ] ) ;
129129 } ) ;
130130
@@ -134,16 +134,16 @@ describe('buildSearchRecords', () => {
134134 items : [
135135 childItem ( 'List' , 'http' ) ,
136136 childItem ( 'Create' , 'http' ) ,
137- childItem ( 'Nested' , 'folder' , [ childItem ( 'Deep' , 'http' ) , childItem ( 'Deeper' , 'folder' , [ childItem ( 'Deepest' , 'http' ) ] ) ] ) ,
138- ] ,
137+ childItem ( 'Nested' , 'folder' , [ childItem ( 'Deep' , 'http' ) , childItem ( 'Deeper' , 'folder' , [ childItem ( 'Deepest' , 'http' ) ] ) ] )
138+ ]
139139 } ) ;
140140 expect ( folderRecords ( [ entry ] ) [ 0 ] . requestCount ) . toBe ( 4 ) ;
141141 } ) ;
142142
143143 it ( 'does not count script files as requests' , ( ) => {
144144 const entry = folderEntry ( {
145145 uuid : 'f1' ,
146- items : [ childItem ( 'List' , 'http' ) , childItem ( 'setup' , 'script' ) ] ,
146+ items : [ childItem ( 'List' , 'http' ) , childItem ( 'setup' , 'script' ) ]
147147 } ) ;
148148 expect ( folderRecords ( [ entry ] ) [ 0 ] . requestCount ) . toBe ( 1 ) ;
149149 } ) ;
@@ -153,7 +153,7 @@ describe('buildSearchRecords', () => {
153153 slug : '' , type : 'overview' , name : 'Overview' , item : null , ancestors : [ ] , depth : - 1 ,
154154 } ;
155155 const environments : NavEntry = {
156- slug : '~environments' , type : 'environments' , name : 'Environments' , item : null , ancestors : [ ] , depth : - 1 ,
156+ slug : '~environments' , type : 'environments' , name : 'Environments' , item : null , ancestors : [ ] , depth : - 1
157157 } ;
158158 expect ( buildSearchRecords ( [ overview , environments ] ) ) . toHaveLength ( 0 ) ;
159159 } ) ;
@@ -171,27 +171,27 @@ describe('formatBreadcrumb', () => {
171171 expect ( formatBreadcrumb ( [ 'Hotels' ] ) ) . toEqual ( { full : 'Hotels' , display : 'Hotels' } ) ;
172172 expect ( formatBreadcrumb ( [ 'Hotels' , 'Auth' , 'Auth 2' ] ) ) . toEqual ( {
173173 full : 'Hotels / Auth / Auth 2' ,
174- display : 'Hotels / Auth / Auth 2' ,
174+ display : 'Hotels / Auth / Auth 2'
175175 } ) ;
176176 } ) ;
177177
178178 it ( 'collapses the middle of a deeper chain, keeping the first and last folder' , ( ) => {
179179 expect ( formatBreadcrumb ( [ 'Hotels' , 'Auth' , 'Auth 2' , 'Legacy' ] ) ) . toEqual ( {
180180 full : 'Hotels / Auth / Auth 2 / Legacy' ,
181- display : 'Hotels / … / Legacy' ,
181+ display : 'Hotels / … / Legacy'
182182 } ) ;
183183 } ) ;
184184
185185 it ( 'counts folders, not separators, so a name holding " / " cannot mis-segment' , ( ) => {
186186 // Three folders, the middle one carrying a separator inside its own name.
187187 expect ( formatBreadcrumb ( [ 'Billing' , 'A / B' , 'Payments' ] ) ) . toEqual ( {
188188 full : 'Billing / A / B / Payments' ,
189- display : 'Billing / A / B / Payments' ,
189+ display : 'Billing / A / B / Payments'
190190 } ) ;
191191 // Four folders elide from the ends, however many separators the names hold.
192192 expect ( formatBreadcrumb ( [ 'Billing' , 'A / B' , 'Payments' , 'v3' ] ) ) . toEqual ( {
193193 full : 'Billing / A / B / Payments / v3' ,
194- display : 'Billing / … / v3' ,
194+ display : 'Billing / … / v3'
195195 } ) ;
196196 } ) ;
197197} ) ;
@@ -222,11 +222,11 @@ describe('collectMethods', () => {
222222} ) ;
223223
224224const rec = ( over : Partial < RequestSearchRecord > ) : RequestSearchRecord => ( {
225- type : 'request' , id : 'id' , slug : 's' , name : '' , method : 'GET' , ancestorNames : [ ] , ancestorSlugs : [ ] , url : '' , ...over ,
225+ type : 'request' , id : 'id' , slug : 's' , name : '' , method : 'GET' , ancestorNames : [ ] , ancestorSlugs : [ ] , url : '' , ...over
226226} ) ;
227227
228228const folderRec = ( over : Partial < FolderSearchRecord > ) : FolderSearchRecord => ( {
229- type : 'folder' , id : 'fid' , slug : 'f' , name : '' , ancestorNames : [ ] , ancestorSlugs : [ ] , requestCount : 0 , ...over ,
229+ type : 'folder' , id : 'fid' , slug : 'f' , name : '' , ancestorNames : [ ] , ancestorSlugs : [ ] , requestCount : 0 , ...over
230230} ) ;
231231
232232/** Substrings the reported ranges actually cover, for match-locality assertions. */
@@ -241,7 +241,7 @@ const BILLING: RequestSearchRecord[] = [
241241 rec ( { id : 'invoices' , name : 'Get All Invoices' , ancestorNames : [ 'Billing' ] , url : '{{baseUrl}}/billing/invoices' } ) ,
242242 rec ( { id : 'customers' , name : 'Get All Customers' , ancestorNames : [ 'Billing' ] , url : '{{baseUrl}}/billing/customers' } ) ,
243243 rec ( { id : 'subs' , name : 'Get All Subscriptions' , ancestorNames : [ 'Billing' ] , url : '{{baseUrl}}/billing/subscriptions' } ) ,
244- rec ( { id : 'currencies' , name : 'Get Currencies' , ancestorNames : [ 'Billing' , 'Lookups' ] , url : '{{baseUrl}}/billing/lookups/currencies' } ) ,
244+ rec ( { id : 'currencies' , name : 'Get Currencies' , ancestorNames : [ 'Billing' , 'Lookups' ] , url : '{{baseUrl}}/billing/lookups/currencies' } )
245245] ;
246246
247247describe ( 'searchHits - empty & degenerate queries' , ( ) => {
@@ -367,7 +367,7 @@ describe('orderFoldersFirst', () => {
367367 hit ( rec ( { id : 'r1' } ) ) ,
368368 hit ( folderRec ( { id : 'f1' } ) ) ,
369369 hit ( rec ( { id : 'r2' } ) ) ,
370- hit ( folderRec ( { id : 'f2' } ) ) ,
370+ hit ( folderRec ( { id : 'f2' } ) )
371371 ] ) ;
372372 expect ( ordered . map ( ( h ) => h . record . id ) ) . toEqual ( [ 'f1' , 'f2' , 'r1' , 'r2' ] ) ;
373373 } ) ;
0 commit comments