mirror of https://github.com/aminya/setup-cpp
14 lines
323 B
TypeScript
14 lines
323 B
TypeScript
|
import * as https from "https"
|
||
|
|
||
|
export function isValidUrl(url: string) {
|
||
|
return new Promise<boolean>((resolve) => {
|
||
|
https.get(url, (res) => {
|
||
|
if (res.statusCode !== undefined && res.statusCode >= 200 && res.statusCode <= 399) {
|
||
|
resolve(true)
|
||
|
} else {
|
||
|
resolve(false)
|
||
|
}
|
||
|
})
|
||
|
})
|
||
|
}
|