@@ -124,7 +124,7 @@ export abstract class AbstractFile implements FileAttachment {
124124 return ( await fetchFile ( this ) ) . body ! ;
125125 }
126126 async dsv ( { delimiter = "," , array = false , typed = false } = { } ) : Promise < DsvResult > {
127- const [ text , d3 ] = await Promise . all ( [ this . text ( ) , import ( "npm: d3-dsv" ) ] ) ;
127+ const [ text , d3 ] = await Promise . all ( [ this . text ( ) , import ( "https://cdn.jsdelivr.net/npm/ d3-dsv/+esm " ) ] ) ; // prettier-ignore
128128 const format = d3 . dsvFormat ( delimiter ) ;
129129 const parse = array ? format . parseRows : format . parse ;
130130 return parse ( text , typed && d3 . autoType ) ;
@@ -147,18 +147,17 @@ export abstract class AbstractFile implements FileAttachment {
147147 } ) ;
148148 }
149149 async arrow ( ) : Promise < any > {
150- const [ Arrow , response ] = await Promise . all ( [ import ( "npm: apache-arrow" ) , fetchFile ( this ) ] ) ;
150+ const [ Arrow , response ] = await Promise . all ( [ import ( "https://cdn.jsdelivr.net/npm/ apache-arrow@17.0.0/+esm " ) , fetchFile ( this ) ] ) ; // prettier-ignore
151151 return Arrow . tableFromIPC ( response ) ;
152152 }
153153 async arquero ( options ?: any ) : Promise < any > {
154- let request ;
155- let from ;
154+ let request : Promise < unknown > ;
155+ let from : string ;
156156 switch ( this . mimeType ) {
157157 case "application/json" :
158158 request = this . text ( ) ;
159159 from = "fromJSON" ;
160160 break ;
161- // @ts -expect-error fall through
162161 case "text/tab-separated-values" :
163162 if ( options ?. delimiter === undefined ) options = { ...options , delimiter : "\t" } ;
164163 // fall through
@@ -178,11 +177,11 @@ export abstract class AbstractFile implements FileAttachment {
178177 }
179178 break ;
180179 }
181- const [ aq , body ] = await Promise . all ( [ import ( "npm: arquero" ) , request ] ) ;
180+ const [ aq , body ] = await Promise . all ( [ import ( "https://cdn.jsdelivr.net/npm/ arquero/+esm " ) , request ] ) ; // prettier-ignore
182181 return aq [ from ] ( body , options ) ;
183182 }
184183 async parquet ( ) {
185- const [ Arrow , Parquet , buffer ] = await Promise . all ( [ import ( "npm: apache-arrow" ) , import ( "npm: parquet-wasm" ) . then ( async ( Parquet ) => ( await Parquet . default ( "https://cdn.jsdelivr.net/npm/parquet-wasm/esm/parquet_wasm_bg.wasm" ) , Parquet ) ) , this . arrayBuffer ( ) ] ) ; // prettier-ignore
184+ const [ Arrow , Parquet , buffer ] = await Promise . all ( [ import ( "https://cdn.jsdelivr.net/npm/ apache-arrow@17.0.0/+esm " ) , import ( "https://cdn.jsdelivr.net/npm/ parquet-wasm/+esm " ) . then ( async ( Parquet ) => ( await Parquet . default ( "https://cdn.jsdelivr.net/npm/parquet-wasm/esm/parquet_wasm_bg.wasm" ) , Parquet ) ) , this . arrayBuffer ( ) ] ) ; // prettier-ignore
186185 return Arrow . tableFromIPC ( Parquet . readParquet ( new Uint8Array ( buffer ) ) . intoIPCStream ( ) ) ;
187186 }
188187 async xml ( mimeType : DOMParserSupportedType = "application/xml" ) : Promise < Document > {
0 commit comments