fix: added dependencies for development. feat: added axios as dependency. feat: added some initial modeals. feat: setup unit testing

This commit is contained in:
StevanFreeborn
2023-01-25 22:28:45 -06:00
parent 5cec90600a
commit dc90ac9a9d
9 changed files with 2552 additions and 8 deletions
+17
View File
@@ -0,0 +1,17 @@
export class ArgumentValidator {
public static isNullOrWhiteSpace(value: string | null | undefined): boolean {
return value === null || value === undefined || (/^\s*$/).test(value);
}
public static isValidUrl(value: string | null | undefined): boolean {
let url: URL;
try {
url = new URL(value);
} catch (error) {
return false;
}
return url.protocol === 'http:' || url.protocol === 'https:';
}
}