File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ export class WebBlob extends Blob {
6060
6161 override slice ( start = 0 , end = this . size ) : WebBlob {
6262 if ( start < 0 || end < 0 ) {
63- new TypeError ( "Unsupported negative start/end on FileBlob .slice" ) ;
63+ new TypeError ( "Unsupported negative start/end on WebBlob .slice" ) ;
6464 }
6565
6666 const slice = new WebBlob (
Original file line number Diff line number Diff line change 1+ import type { CredentialsParams } from "../types/public" ;
2+ import { checkCredentials } from "./checkCredentials" ;
3+
4+ type XetBlobCreateOptions = {
5+ /**
6+ * Custom fetch function to use instead of the default one, for example to use a proxy or edit headers.
7+ */
8+ fetch ?: typeof fetch ;
9+ } & Partial < CredentialsParams > ;
10+
11+ /**
12+ * XetBlob is a blob implementation that fetches data directly from the Xet storage
13+ */
14+ export class XetBlob extends Blob {
15+ fetch : typeof fetch ;
16+ accessToken ?: string ;
17+
18+ constructor ( params : XetBlobCreateOptions ) {
19+ super ( [ ] ) ;
20+
21+ this . fetch = params . fetch ?? fetch ;
22+ this . accessToken = checkCredentials ( params ) ;
23+ }
24+ }
You can’t perform that action at this time.
0 commit comments