}
}
- private static objectHasOwnProperty(object: any, property: string): boolean {
+ private static objectHasOwnProperty(object: unknown, property: string): boolean {
return Object.prototype.hasOwnProperty.call(object, property) as boolean;
}
- private static isUndefined(obj: any): boolean {
+ private static isUndefined(obj: unknown): boolean {
return typeof obj === 'undefined';
}
}
}
- static convertToDate(value: any): Date {
+ static convertToDate(value: unknown): Date {
// Check
if (!value) {
- return value;
+ return value as Date;
}
// Check Type
if (!(value instanceof Date)) {
- return new Date(value);
+ return new Date(value as string);
}
return value;
}
- static convertToInt(value: any): number {
- let changedValue: number = value;
+ static convertToInt(value: unknown): number {
+ let changedValue: number = value as number;
if (!value) {
return 0;
}
// Check
if (Utils.isString(value)) {
// Create Object
- changedValue = parseInt(value);
+ changedValue = parseInt(value as string);
}
return changedValue;
}
- static convertToFloat(value: any): number {
- let changedValue: number = value;
+ static convertToFloat(value: unknown): number {
+ let changedValue: number = value as number;
if (!value) {
return 0;
}
// Check
if (Utils.isString(value)) {
// Create Object
- changedValue = parseFloat(value);
+ changedValue = parseFloat(value as string);
}
return changedValue;
}
- static convertToBoolean(value: any): boolean {
+ static convertToBoolean(value: unknown): boolean {
let result = false;
// Check boolean
if (value) {
return false;
}
- static isEmptyJSon(document: any): boolean {
+ static isEmptyJSon(document: unknown): boolean {
// Empty?
if (!document) {
return true;
return Object.keys(document).length === 0;
}
- static isString(value: any): boolean {
+ static isString(value: unknown): boolean {
return typeof value === 'string';
}
- static isUndefined(value: any): boolean {
+ static isUndefined(value: unknown): boolean {
return typeof value === 'undefined';
}
- static isNullOrUndefined(value: any): boolean {
+ static isNullOrUndefined(value: unknown): boolean {
// eslint-disable-next-line no-eq-null, eqeqeq
if (value == null) {
return true;
return false;
}
- static isEmptyArray(object: any): boolean {
+ static isEmptyArray(object: unknown): boolean {
if (!object) {
return true;
}
return true;
}
- static isEmptyObject(obj: any): boolean {
+ static isEmptyObject(obj: Record<string, unknown>): boolean {
return !Object.keys(obj).length;
}