fix: enabled strict null checks and made changes to deal with this compiler change. fix: modified endpoint factory methods to not need baseURL to be passed in. instead just return endpoint because the axios client with already have a default url set as part of constructing a new onspring client instance
This commit is contained in:
@@ -17,6 +17,10 @@ export class ArgumentValidator {
|
||||
public static isValidUrl(value: string | null | undefined): boolean {
|
||||
let url: URL;
|
||||
|
||||
if (value === null || value === undefined) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
url = new URL(value);
|
||||
} catch (error) {
|
||||
@@ -32,6 +36,10 @@ export class ArgumentValidator {
|
||||
* @remarks - A valid page size is a number greater than 0 and less than or equal to 1000.
|
||||
*/
|
||||
public static isValidPageSize(value: number | null | undefined): boolean {
|
||||
if (value === null || value === undefined) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return value > 0 && value <= 1000;
|
||||
}
|
||||
|
||||
@@ -41,6 +49,10 @@ export class ArgumentValidator {
|
||||
* @remarks - A valid page number is a number greater than 0.
|
||||
*/
|
||||
public static isValidPageNumber(value: number | null | undefined): boolean {
|
||||
if (value === null || value === undefined) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return value > 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user