File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
- import * as io from "https://deno.land/std@0.159.0/io /mod.ts" ;
1
+ import * as streams from "https://deno.land/std@0.159.0/streams /mod.ts" ;
2
2
3
3
export async function downloadString ( url : string ) : Promise < string > {
4
4
const textDecoder = new TextDecoder ( ) ;
5
5
const response = await fetch ( url ) ;
6
6
if ( ! response . body ) {
7
7
throw new Error ( `Failed to read ${ url } ` ) ;
8
8
}
9
- const reader = io . readerFromStreamReader ( response . body . getReader ( ) ) ;
10
- return textDecoder . decode ( await io . readAll ( reader ) ) ;
9
+ const reader = streams . readerFromStreamReader ( response . body . getReader ( ) ) ;
10
+ return textDecoder . decode ( await streams . readAll ( reader ) ) ;
11
11
}
12
12
13
13
export function regexIndexOf ( s : string , pattern : RegExp , offset = 0 ) : number {
Original file line number Diff line number Diff line change 1
- import * as io from "https://deno.land/std@0.159.0/io /mod.ts" ;
1
+ import * as streams from "https://deno.land/std@0.159.0/streams /mod.ts" ;
2
2
3
3
export async function downloadString ( url : string ) : Promise < string > {
4
4
const textDecoder = new TextDecoder ( ) ;
5
5
const response = await fetch ( url ) ;
6
6
if ( ! response . body ) {
7
7
throw new Error ( `Failed to read ${ url } ` ) ;
8
8
}
9
- const reader = io . readerFromStreamReader ( response . body . getReader ( ) ) ;
10
- return textDecoder . decode ( await io . readAll ( reader ) ) ;
9
+ const reader = streams . readerFromStreamReader ( response . body . getReader ( ) ) ;
10
+ return textDecoder . decode ( await streams . readAll ( reader ) ) ;
11
11
}
12
12
13
13
export function regexIndexOf ( s : string , pattern : RegExp , offset = 0 ) : number {
You can’t perform that action at this time.
0 commit comments