@@ -59,7 +59,7 @@ export function hubBlob() {
59
59
}
60
60
const bucket = _useBucket ( )
61
61
62
- return {
62
+ const blob = {
63
63
async list ( options : BlobListOptions = { limit : 1000 } ) {
64
64
const resolvedOptions = defu ( options , {
65
65
limit : 500 ,
@@ -126,14 +126,18 @@ export function hubBlob() {
126
126
127
127
return mapR2ObjectToBlob ( object )
128
128
} ,
129
- async delete ( pathnames : string | string [ ] ) {
129
+ async del ( pathnames : string | string [ ] ) {
130
130
if ( Array . isArray ( pathnames ) ) {
131
131
return await bucket . delete ( pathnames . map ( ( p ) => decodeURI ( p ) ) )
132
132
} else {
133
133
return await bucket . delete ( decodeURI ( pathnames ) )
134
134
}
135
135
}
136
136
}
137
+ return {
138
+ ...blob ,
139
+ delete : blob . del
140
+ }
137
141
}
138
142
139
143
export function proxyHubBlob ( projectUrl : string , secretKey ?: string ) {
@@ -144,7 +148,7 @@ export function proxyHubBlob(projectUrl: string, secretKey?: string) {
144
148
}
145
149
} )
146
150
147
- return {
151
+ const blob = {
148
152
async list ( options : BlobListOptions = { limit : 1000 } ) {
149
153
return blobAPI < BlobObject [ ] > ( '/' , {
150
154
method : 'GET' ,
@@ -174,7 +178,7 @@ export function proxyHubBlob(projectUrl: string, secretKey?: string) {
174
178
} )
175
179
return JSON . parse ( headers . get ( 'x-blob' ) || '{}' ) as BlobObject
176
180
} ,
177
- async delete ( pathnames : string | string [ ] ) {
181
+ async del ( pathnames : string | string [ ] ) {
178
182
if ( Array . isArray ( pathnames ) ) {
179
183
await blobAPI < void > ( '/delete' , {
180
184
method : 'POST' ,
@@ -190,6 +194,11 @@ export function proxyHubBlob(projectUrl: string, secretKey?: string) {
190
194
return
191
195
}
192
196
}
197
+
198
+ return {
199
+ ...blob ,
200
+ delete : blob . del
201
+ }
193
202
}
194
203
195
204
function getContentType ( pathOrExtension ?: string ) {
0 commit comments