diff --git a/src/main/Queue.ts b/src/main/Queue.ts index 4206cd0f..6fb7d19a 100644 --- a/src/main/Queue.ts +++ b/src/main/Queue.ts @@ -17,14 +17,10 @@ export class Queue { return this.Q.asArray } - public get length(): UIO { - return this.Q.length - } - /** - * Returns the current size of the queue + * Returns the number of elements in the queue */ - public get size(): UIO { + public get length(): UIO { return this.Q.length } diff --git a/test/Queue.test.ts b/test/Queue.test.ts index d6983e16..5fa29534 100644 --- a/test/Queue.test.ts +++ b/test/Queue.test.ts @@ -20,7 +20,7 @@ describe('Queue', () => { describe('offer', () => { it('should add the element to the queue', () => { const actual = testRuntime().unsafeExecuteSync( - Queue.unbounded().chain(Q => Q.offer(1000).and(Q.size)) + Queue.unbounded().chain(Q => Q.offer(1000).and(Q.length)) ) const expected = 1 @@ -32,7 +32,7 @@ describe('Queue', () => { it('should add multiple elements to the queue', () => { const actual = testRuntime().unsafeExecuteSync( Queue.unbounded().chain(Q => - Q.offerAll(1, 2, 3, 4, 5).and(Q.size) + Q.offerAll(1, 2, 3, 4, 5).and(Q.length) ) ) const expected = 5