feat(BackpressuredArray): Add method to check if items are present in BackpressuredArray

This commit is contained in:
2024-10-13 20:40:40 +02:00
parent 753b829d18
commit 32397a97cd
3 changed files with 61 additions and 2 deletions

View File

@ -1,8 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
* autocreated commitinfo by @push.rocks/commitinfo
*/
export const commitinfo = {
name: '@push.rocks/lik',
version: '6.0.15',
version: '6.1.0',
description: 'Provides a collection of lightweight helpers and utilities for Node.js projects.'
}

View File

@ -34,6 +34,10 @@ export class BackpressuredArray<T> {
return this.data.length < this.highWaterMark;
}
public checkHasItems(): boolean {
return this.data.length > 0;
}
waitForSpace(): Promise<void> {
return new Promise<void>((resolve) => {
if (this.checkSpaceAvailable()) {