refactor: use null test in circular array code
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 29 Jul 2023 14:17:38 +0000 (16:17 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 29 Jul 2023 14:17:38 +0000 (16:17 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/circular-array.ts

index dadfa950043577a66d50387e59af621045bad66e..bb958d8287519acf91efc4c7a1468fe422da0a86 100644 (file)
@@ -57,7 +57,7 @@ export class CircularArray<T> extends Array<T> {
     ...items: T[]
   ): CircularArray<T> {
     let itemsRemoved: T[] = []
-    if (arguments.length >= 3 && deleteCount !== undefined) {
+    if (arguments.length >= 3 && deleteCount != null) {
       itemsRemoved = super.splice(start, deleteCount, ...items)
       if (this.length > this.size) {
         const itemsOverflowing = super.splice(0, this.length - this.size)