@@ -59,7 +59,7 @@ export function hubBlob() {
5959 }
6060 const bucket = _useBucket ( )
6161
62- return {
62+ const blob = {
6363 async list ( options : BlobListOptions = { limit : 1000 } ) {
6464 const resolvedOptions = defu ( options , {
6565 limit : 500 ,
@@ -126,14 +126,18 @@ export function hubBlob() {
126126
127127 return mapR2ObjectToBlob ( object )
128128 } ,
129- async delete ( pathnames : string | string [ ] ) {
129+ async del ( pathnames : string | string [ ] ) {
130130 if ( Array . isArray ( pathnames ) ) {
131131 return await bucket . delete ( pathnames . map ( ( p ) => decodeURI ( p ) ) )
132132 } else {
133133 return await bucket . delete ( decodeURI ( pathnames ) )
134134 }
135135 }
136136 }
137+ return {
138+ ...blob ,
139+ delete : blob . del
140+ }
137141}
138142
139143export function proxyHubBlob ( projectUrl : string , secretKey ?: string ) {
@@ -144,7 +148,7 @@ export function proxyHubBlob(projectUrl: string, secretKey?: string) {
144148 }
145149 } )
146150
147- return {
151+ const blob = {
148152 async list ( options : BlobListOptions = { limit : 1000 } ) {
149153 return blobAPI < BlobObject [ ] > ( '/' , {
150154 method : 'GET' ,
@@ -174,7 +178,7 @@ export function proxyHubBlob(projectUrl: string, secretKey?: string) {
174178 } )
175179 return JSON . parse ( headers . get ( 'x-blob' ) || '{}' ) as BlobObject
176180 } ,
177- async delete ( pathnames : string | string [ ] ) {
181+ async del ( pathnames : string | string [ ] ) {
178182 if ( Array . isArray ( pathnames ) ) {
179183 await blobAPI < void > ( '/delete' , {
180184 method : 'POST' ,
@@ -190,6 +194,11 @@ export function proxyHubBlob(projectUrl: string, secretKey?: string) {
190194 return
191195 }
192196 }
197+
198+ return {
199+ ...blob ,
200+ delete : blob . del
201+ }
193202}
194203
195204function getContentType ( pathOrExtension ?: string ) {
0 commit comments