File tree 2 files changed +7
-8
lines changed
2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 1
- import { URL } from " url" ;
1
+ import { URL } from ' url' ;
2
2
3
3
interface ValidURLCheckResult {
4
4
isValid : boolean ;
@@ -8,16 +8,15 @@ interface ValidURLCheckResult {
8
8
export function isValidURL ( str : string ) : ValidURLCheckResult {
9
9
try {
10
10
if ( ! str . startsWith ( 'https://' ) && ! str . startsWith ( 'http://' ) ) {
11
- str = 'https://' + str
12
-
11
+ str = 'https://' + str ;
13
12
}
14
- const parsedUrl = new URL ( str )
15
- const regex = / ^ ( [ a - z A - Z 0 - 9 - _ .: ] + ) + $ /
13
+ const parsedUrl = new URL ( str ) ;
14
+ const regex = / ^ ( [ a - z A - Z 0 - 9 - _ .: ] + ) + $ / ;
16
15
return {
17
16
isValid : regex . test ( parsedUrl . host ) ,
18
17
finalURL : str
19
- }
18
+ } ;
20
19
} catch ( e ) {
21
- return { isValid : false , finalURL : str }
20
+ return { isValid : false , finalURL : str } ;
22
21
}
23
22
}
Original file line number Diff line number Diff line change 9
9
"main" : " build/electron/main.js" ,
10
10
"private" : true ,
11
11
"scripts" : {
12
- "run-audit" : " yarn audit-ci --high -a 1094574 1096494 1096640 " ,
12
+ "run-audit" : " yarn audit-ci --high -a 1094574 1096494 1096698 " ,
13
13
"start" : " node scripts/start.js" ,
14
14
"build" : " cross-env NODE_OPTIONS=--max_old_space_size=8192 && yarn clean-builds && node scripts/build.js" ,
15
15
"test" : " node scripts/test.js --watchAll=false" ,
You can’t perform that action at this time.
0 commit comments