File tree Expand file tree Collapse file tree 5 files changed +14
-13
lines changed Expand file tree Collapse file tree 5 files changed +14
-13
lines changed Original file line number Diff line number Diff line change 12
12
node-version :
13
13
- 18
14
14
- 16
15
- - 14
16
15
steps :
17
16
- uses : actions/checkout@v3
18
17
- uses : actions/setup-node@v3
Original file line number Diff line number Diff line change 2
2
import process from 'node:process' ;
3
3
import meow from 'meow' ;
4
4
import captureWebsite from 'capture-website' ;
5
- import arrify from 'arrify' ;
6
5
import splitOnFirst from 'split-on-first' ;
7
6
import getStdin from 'get-stdin' ;
8
7
@@ -166,6 +165,7 @@ const cli = meow(`
166
165
} ,
167
166
header : {
168
167
type : 'string' ,
168
+ isMultiple : true ,
169
169
} ,
170
170
userAgent : {
171
171
type : 'string' ,
@@ -222,11 +222,13 @@ if (options.clip) {
222
222
}
223
223
224
224
options . headers = { } ;
225
- for ( const header of arrify ( options . header ) ) {
225
+ for ( const header of options . header ) {
226
226
const [ key , value ] = header . split ( ':' ) ;
227
227
options . headers [ key . trim ( ) ] = value . trim ( ) ;
228
228
}
229
229
230
+ delete options . header ;
231
+
230
232
if ( options . authentication ) {
231
233
const [ username , password ] = splitOnFirst ( options . authentication , ':' ) ;
232
234
options . authentication = { username, password} ;
@@ -256,7 +258,7 @@ if (options.inset) {
256
258
257
259
options . isJavaScriptEnabled = options . javascript ;
258
260
259
- ( async ( ) => {
261
+ async function main ( ) {
260
262
const {
261
263
internalPrintFlags,
262
264
listDevices,
@@ -288,4 +290,6 @@ options.isJavaScriptEnabled = options.javascript;
288
290
} else {
289
291
process . stdout . write ( await captureWebsite . buffer ( input , options ) ) ;
290
292
}
291
- } ) ( ) ;
293
+ }
294
+
295
+ await main ( ) ;
Original file line number Diff line number Diff line change 41
41
" jpg"
42
42
],
43
43
"dependencies" : {
44
- "arrify" : " ^3.0.0" ,
45
- "capture-website" : " ^3.0.0" ,
44
+ "capture-website" : " ^3.2.0" ,
46
45
"get-stdin" : " ^9.0.0" ,
47
- "meow" : " ^10.1.3 " ,
46
+ "meow" : " ^11.0.0 " ,
48
47
"split-on-first" : " ^3.0.0"
49
48
},
50
49
"devDependencies" : {
51
- "ava" : " ^4.3.1 " ,
50
+ "ava" : " ^5.2.0 " ,
52
51
"create-test-server" : " ^3.0.1" ,
53
- "execa" : " ^6 .1.0 " ,
54
- "file-type" : " ^17.1.6 " ,
55
- "xo" : " ^0.51.0 "
52
+ "execa" : " ^7 .1.1 " ,
53
+ "file-type" : " ^18.2.1 " ,
54
+ "xo" : " ^0.54.1 "
56
55
}
57
56
}
Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ Generated by [AVA](https://avajs.dev).
32
32
element: '.main-content',
33
33
emulateDevice: 'iPhone X',
34
34
fullPage: false,
35
- header: 'x-powered-by: capture-website-cli',
36
35
headers: {
37
36
'x-powered-by': 'capture-website-cli',
38
37
},
You can’t perform that action at this time.
0 commit comments