Compare commits

...

18 Commits

Author SHA1 Message Date
5e31dbb504 6.0.14 2024-02-25 13:01:07 +01:00
b2ca6e13e7 fix(core): update 2024-02-25 13:01:06 +01:00
052322fb98 6.0.13 2024-02-23 17:44:52 +01:00
9e1eb0b3a0 fix(core): update 2024-02-23 17:44:51 +01:00
af9b045d31 6.0.12 2023-11-13 17:20:46 +01:00
d7718d4340 fix(core): update 2023-11-13 17:20:45 +01:00
92592d9e9a 6.0.11 2023-11-13 16:44:39 +01:00
a786c43970 fix(core): update 2023-11-13 16:44:38 +01:00
66658dc877 6.0.10 2023-11-13 16:43:07 +01:00
be78d74124 fix(core): update 2023-11-13 16:43:06 +01:00
bde0404777 6.0.9 2023-11-13 16:27:05 +01:00
dfe973f5d8 fix(core): update 2023-11-13 16:27:04 +01:00
326030456f 6.0.8 2023-11-13 14:59:04 +01:00
184dc98127 fix(core): update 2023-11-13 14:59:03 +01:00
702ce00288 6.0.7 2023-11-13 14:40:02 +01:00
ff0d745170 fix(core): update 2023-11-13 14:40:01 +01:00
8fc0438c75 6.0.6 2023-11-09 21:17:14 +01:00
355c2d132e fix(core): update 2023-11-09 21:17:13 +01:00
26 changed files with 3152 additions and 1302 deletions

View File

@ -119,6 +119,6 @@ jobs:
run: |
npmci node install stable
npmci npm install
pnpm install -g @gitzone/tsdoc
pnpm install -g @git.zone/tsdoc
npmci command tsdoc
continue-on-error: true

View File

@ -1,6 +1,6 @@
{
"name": "@push.rocks/lik",
"version": "6.0.5",
"version": "6.0.14",
"private": false,
"description": "light little helpers for node",
"main": "dist_ts/index.js",
@ -22,21 +22,21 @@
},
"homepage": "https://gitlab.com/pushrocks/lik#README",
"devDependencies": {
"@gitzone/tsbuild": "^2.1.63",
"@gitzone/tsbundle": "^2.0.4",
"@gitzone/tsrun": "^1.2.39",
"@gitzone/tstest": "^1.0.71",
"@pushrocks/tapbundle": "^5.0.3",
"@types/node": "^18.11.18"
"@git.zone/tsbuild": "^2.1.66",
"@git.zone/tsbundle": "^2.0.8",
"@git.zone/tsrun": "^1.2.44",
"@git.zone/tstest": "^1.0.77",
"@pushrocks/tapbundle": "^5.0.8",
"@types/node": "^20.9.0"
},
"dependencies": {
"@push.rocks/smartdelay": "^3.0.2",
"@push.rocks/smartdelay": "^3.0.5",
"@push.rocks/smartmatch": "^2.0.0",
"@push.rocks/smartpromise": "^4.0.3",
"@push.rocks/smartrx": "^3.0.0",
"@push.rocks/smarttime": "^4.0.1",
"@push.rocks/smartrx": "^3.0.7",
"@push.rocks/smarttime": "^4.0.6",
"@types/minimatch": "^5.1.2",
"@types/symbol-tree": "^3.2.2",
"@types/symbol-tree": "^3.2.5",
"symbol-tree": "^3.2.4"
},
"files": [

4297
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -26,4 +26,4 @@ tap.test('should run in parallel', async (toolsArg) => {
}, 0);
});
tap.start();
await tap.start();

View File

@ -27,4 +27,4 @@ tap.test('should find an entry', async () => {
expect(result.value1).toEqual('heyho3');
});
tap.start();
await tap.start();

View File

@ -22,4 +22,4 @@ tap.test('should be able to inform about a lost interest', async () => {
testInterestmap.informLostInterest(3);
});
tap.start();
await tap.start();

View File

@ -14,4 +14,4 @@ tap.test('should never be longer than the set length', async () => {
expect(testLimitedArray.array.length < 7).toBeTrue();
});
tap.start();
await tap.start();

View File

@ -21,4 +21,4 @@ tap.test('should add objects once and return true', async () => {
expect(myLoopTracker.checkAndTrack(object2)).toBeFalse();
});
tap.start();
await tap.start();

View File

@ -73,4 +73,4 @@ tap.test('should get one object and then remove it', async () => {
expect(testObjectmap.getArray()).not.toContain(oneObject);
});
tap.start();
await tap.start();

View File

@ -83,4 +83,4 @@ tap.test('lik.Stringmap.empty() -> should remove wipe and then notify', async ()
testStringmap.wipe();
});
tap.start();
await tap.start();

View File

@ -20,4 +20,4 @@ tap.test('should create a timed aggregaotor', async (tools) => {
await tools.delayFor(2000);
});
tap.start();
await tap.start();

View File

@ -37,4 +37,4 @@ tap.test("should create a JSON object that reflects a tree's hierachy", async ()
const jsonTreet = testTree.toJsonWithHierachy(testInstance);
});
tap.start();
await tap.start();

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/lik',
version: '6.0.5',
version: '6.0.14',
description: 'light little helpers for node'
}

View File

@ -1,4 +1,4 @@
import * as plugins from './lik.plugins.js';
import * as plugins from './classes.plugins.js';
interface IExecutionSlot<T> {
executionDeferred: plugins.smartpromise.Deferred<T>;

View File

@ -0,0 +1,62 @@
import * as plugins from './classes.plugins.js';
export class BackpressuredArray<T> {
public data: T[];
private highWaterMark: number;
public hasSpace = new plugins.smartrx.rxjs.Subject<'hasSpace'>();
private itemsAvailable = new plugins.smartrx.rxjs.Subject<'itemsAvailable'>();
constructor(highWaterMark: number = 16) {
this.data = [];
this.highWaterMark = highWaterMark;
}
push(item: T): boolean {
this.data.push(item);
this.itemsAvailable.next('itemsAvailable');
const spaceAvailable = this.checkSpaceAvailable();
if (spaceAvailable) {
this.hasSpace.next('hasSpace');
}
return spaceAvailable;
}
shift(): T | undefined {
const item = this.data.shift();
if (this.checkSpaceAvailable()) {
this.hasSpace.next('hasSpace');
}
return item;
}
checkSpaceAvailable(): boolean {
return this.data.length < this.highWaterMark;
}
waitForSpace(): Promise<void> {
return new Promise<void>((resolve) => {
if (this.checkSpaceAvailable()) {
resolve();
} else {
const subscription = this.hasSpace.subscribe(() => {
subscription.unsubscribe();
resolve();
});
}
});
}
waitForItems(): Promise<void> {
return new Promise<void>((resolve) => {
if (this.data.length > 0) {
resolve();
} else {
const subscription = this.itemsAvailable.subscribe(() => {
subscription.unsubscribe();
resolve();
});
}
});
}
}

View File

@ -3,7 +3,7 @@ The FastMap has the goal of creating the fastes to use map possible in JS
============ */
import * as plugins from './lik.plugins.js';
import * as plugins from './classes.plugins.js';
/**
* fast map allows for very quick lookups of objects with a unique key

View File

@ -1,6 +1,6 @@
import * as plugins from './lik.plugins.js';
import * as plugins from './classes.plugins.js';
import { InterestMap, IInterestComparisonFunc } from './lik.interestmap.js';
import { InterestMap, type IInterestComparisonFunc } from './classes.interestmap.js';
export interface IInterestOptions<DTInterestFullfillment> {
markLostAfterDefault: number;

View File

@ -8,9 +8,9 @@ Subssequent interests will be mapped to the same interest
which is then is only fullfilled once.
=========== */
import * as plugins from './lik.plugins.js';
import { ObjectMap } from './lik.objectmap.js';
import { Interest } from './lik.interestmap.interest.js';
import * as plugins from './classes.plugins.js';
import { ObjectMap } from './classes.objectmap.js';
import { Interest } from './classes.interestmap.interest.js';
export type IInterestComparisonFunc<T> = (objectArg: T) => string;

View File

@ -1,4 +1,4 @@
import * as plugins from './lik.plugins.js';
import * as plugins from './classes.plugins.js';
export class LimitedArray<T> {
array: T[] = [];

View File

@ -1,6 +1,6 @@
import * as plugins from './lik.plugins.js';
import * as plugins from './classes.plugins.js';
import { ObjectMap } from './lik.objectmap.js';
import { ObjectMap } from './classes.objectmap.js';
export class LoopTracker<T> {
referenceObjectMap = new ObjectMap<any>();

View File

@ -1,5 +1,5 @@
import * as plugins from './lik.plugins.js';
import { FastMap } from './lik.fastmap.js';
import * as plugins from './classes.plugins.js';
import { FastMap } from './classes.fastmap.js';
export const uni = (prefix: string = 'uni') => {
return `${prefix}xxxxxxxxxxx`.replace(/[xy]/g, (c) => {

View File

@ -1,4 +1,4 @@
import * as plugins from './lik.plugins.js';
import * as plugins from './classes.plugins.js';
/**
* allows you to easily keep track of a bunch of strings

View File

@ -1,4 +1,4 @@
import * as plugins from './lik.plugins.js';
import * as plugins from './classes.plugins.js';
export interface ITimedAggregatorOptions<T> {
aggregationIntervalInMillis: number;

View File

@ -1,4 +1,4 @@
import * as plugins from './lik.plugins.js';
import * as plugins from './classes.plugins.js';
export class Tree<T> {
symbolTree: any;

View File

@ -1,10 +1,11 @@
export * from './lik.asyncexecutionstack.js';
export * from './lik.fastmap.js';
export * from './lik.interestmap.js';
export * from './lik.interestmap.interest.js';
export * from './lik.limitedarray.js';
export * from './lik.looptracker.js';
export * from './lik.objectmap.js';
export * from './lik.stringmap.js';
export * from './lik.timedaggregator.js';
export * from './lik.tree.js';
export * from './classes.asyncexecutionstack.js';
export * from './classes.backpressuredarray.js';
export * from './classes.fastmap.js';
export * from './classes.interestmap.js';
export * from './classes.interestmap.interest.js';
export * from './classes.limitedarray.js';
export * from './classes.looptracker.js';
export * from './classes.objectmap.js';
export * from './classes.stringmap.js';
export * from './classes.timedaggregator.js';
export * from './classes.tree.js';