Fix GH actions run on dependabot PRs.
[e-mobility-charging-stations-simulator.git] / src / utils / CircularArray.ts
index cb7e3bf5f5d8f52a1d3aaab704d8ace1cf482098..feb5e3e2b66fb99aef38c6d24db1a6c5eafccfe1 100644 (file)
@@ -1,5 +1,8 @@
-export const DEFAULT_CIRCULAR_ARRAY_SIZE = 2000;
+// Copyright Jerome Benoit. 2021. All Rights Reserved.
 
+export const DEFAULT_CIRCULAR_ARRAY_SIZE = Number.MAX_SAFE_INTEGER;
+
+/** Array with a maximum length shifting items when full. */
 export class CircularArray<T> extends Array<T> {
   public size: number;
 
@@ -25,7 +28,7 @@ export class CircularArray<T> extends Array<T> {
     if (length > this.size) {
       super.splice(this.size, items.length);
     }
-    return length;
+    return this.length;
   }
 
   public concat(...items: (T | ConcatArray<T>)[]): CircularArray<T> {