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

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

55
changelog.md Normal file
View File

@ -0,0 +1,55 @@
# Changelog
## 2024-10-13 - 6.1.0 - feat(BackpressuredArray)
Add method to check if items are present in BackpressuredArray
- Implemented a new method `checkHasItems` in the BackpressuredArray class to determine if the array contains any items.
## 2024-05-29 to 2024-04-18 - 6.0.15
Minor updates were made to documentation and descriptions.
- Update project description
## 2024-04-18 to 2024-02-25 - 6.0.14
Several updates were made to configurations and json files.
- Updated core components in the codebase
- Modified tsconfig settings
- Revised npmextra.json with githost configurations
## 2024-02-25 to 2024-02-23 - 6.0.13
No relevant changes.
## 2024-02-23 to 2023-11-13 - 6.0.12 to 6.0.8
Multiple core updates were performed to ensure stability and performance.
- Fixed various issues in core components
## 2023-11-13 to 2023-08-14 - 6.0.7 to 6.0.3
Minor internal core updates.
## 2023-08-14 to 2023-07-12 - 6.0.2
Implemented a switch to a new organizational scheme.
## 2023-01-18 to 2022-05-27 - 6.0.0
Updated core functionalities; introduced breaking changes for compatibility with ECMAScript modules.
- Core updates
- Switching from CommonJS to ECMAScript modules
## 2022-05-27 to 2022-05-27 - 5.0.6 to 5.0.0
Minor updates and a significant change in `objectmap` behavior to support async operations.
- Included async behaviors in objectmap as a breaking change
## 2020-05-04 to 2020-02-17 - 4.0.0
Refactored ObjectMap; introduced new features.
- Refactored ObjectMap with concat functionality as a breaking change
- Added .clean() to FastMap
## 2020-02-17 to 2020-02-06 - 3.0.19 to 3.0.15
Enhancements and new functionality in ObjectMap.
- Added object mapping enhancements
- Introduced object map with unique keys

View File

@ -1,8 +1,8 @@
/** /**
* autocreated commitinfo by @pushrocks/commitinfo * autocreated commitinfo by @push.rocks/commitinfo
*/ */
export const commitinfo = { export const commitinfo = {
name: '@push.rocks/lik', 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.' 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; return this.data.length < this.highWaterMark;
} }
public checkHasItems(): boolean {
return this.data.length > 0;
}
waitForSpace(): Promise<void> { waitForSpace(): Promise<void> {
return new Promise<void>((resolve) => { return new Promise<void>((resolve) => {
if (this.checkSpaceAvailable()) { if (this.checkSpaceAvailable()) {