@@ -23,12 +23,12 @@ interface FileUrl extends BaseUrl {
2323 resolveUrl : string
2424}
2525
26- type HFUrl = DirectoryUrl | FileUrl ;
26+ type HFUrl = DirectoryUrl | FileUrl
2727
2828interface RefResponse {
29- name : string ;
30- ref : string ;
31- targetCommit : string ;
29+ name : string
30+ ref : string
31+ targetCommit : string
3232}
3333
3434const refTypes = [
@@ -37,11 +37,11 @@ const refTypes = [
3737 'converts' ,
3838 'pullRequests' ,
3939] as const
40- type RefType = ( typeof refTypes ) [ number ] ;
41- type RefsResponse = Partial < Record < RefType , RefResponse [ ] > > ;
40+ type RefType = ( typeof refTypes ) [ number ]
41+ type RefsResponse = Partial < Record < RefType , RefResponse [ ] > >
4242
4343interface RefMetadata extends RefResponse {
44- refType : RefType ; // TODO(SL): use it to style the refs differently?
44+ refType : RefType // TODO(SL): use it to style the refs differently?
4545}
4646
4747const baseUrl = 'https://huggingface.co'
@@ -291,13 +291,13 @@ async function fetchRefsList(
291291 */
292292
293293interface ListFileEntry {
294- type : 'file' | 'directory' | 'unknown' ;
295- size : number ;
296- path : string ;
294+ type : 'file' | 'directory' | 'unknown'
295+ size : number
296+ path : string
297297 lastCommit ?: {
298- date : string ;
299- id : string ;
300- } ;
298+ date : string
299+ id : string
300+ }
301301}
302302
303303const HUB_URL = 'https://huggingface.co'
@@ -308,19 +308,19 @@ const HUB_URL = 'https://huggingface.co'
308308 */
309309async function * listFiles (
310310 params : {
311- repoFullName : string ;
312- /**
313- * Eg 'data' for listing all files in the 'data' folder. Leave it empty to list all
314- * files in the repo.
315- */
316- path ?: string ;
317- revision ?: string ;
318- /**
319- * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers.
320- */
321- fetch ?: typeof fetch ;
322- accessToken ?: string ;
323- }
311+ repoFullName : string
312+ /**
313+ * Eg 'data' for listing all files in the 'data' folder. Leave it empty to list all
314+ * files in the repo.
315+ */
316+ path ?: string
317+ revision ?: string
318+ /**
319+ * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers.
320+ */
321+ fetch ?: typeof fetch
322+ accessToken ?: string
323+ }
324324) : AsyncGenerator < ListFileEntry > {
325325 let url : string | undefined = `${ HUB_URL } /api/${ params . repoFullName } /tree/${
326326 params . revision ?? 'main'
0 commit comments