import clone from 'just-clone';
-import Constants from './Constants';
-import { WebSocketCloseEventStatusString } from '../types/WebSocket';
+import { Constants } from './internal';
+import { WebSocketCloseEventStatusString } from '../types';
-export default class Utils {
+export class Utils {
private constructor() {
// This is intentional
}
}
public static isEmptyArray(object: unknown | unknown[]): boolean {
- if (!Array.isArray(object)) {
+ if (Array.isArray(object) && object.length === 0) {
return true;
}
- if (object.length > 0) {
- return false;
+ return false;
+ }
+
+ public static isNotEmptyArray(object: unknown | unknown[]): boolean {
+ if (Array.isArray(object) && object.length > 0) {
+ return true;
}
- return true;
+ return false;
}
public static isEmptyObject(obj: object): boolean {