Compare commits

..

12 Commits

Author SHA1 Message Date
e1442b1bc8 3.0.13 2019-11-27 23:15:14 +00:00
2ca9e14f76 fix(core): update 2019-11-27 23:15:13 +00:00
e65f36dfa2 3.0.12 2019-11-27 23:00:16 +00:00
adb95cd683 fix(dependencies): update 2019-11-27 23:00:15 +00:00
d2106690b4 3.0.11 2019-08-25 15:58:01 +02:00
2ea5111eb8 fix(core): update 2019-08-25 15:58:00 +02:00
aae10344fe 3.0.10 2019-08-02 16:57:45 +02:00
52b65d7dc3 3.0.9 2019-08-02 16:48:30 +02:00
1135b418cb 3.0.8 2019-08-02 16:38:09 +02:00
2eb1dbd0b3 fix(core): update 2019-08-02 16:38:08 +02:00
8ec54c17a1 3.0.7 2019-08-02 16:33:46 +02:00
500a291b2a fix(core): update 2019-08-02 16:33:45 +02:00
8 changed files with 962 additions and 635 deletions

25
.gitignore vendored
View File

@ -1,5 +1,22 @@
node_modules/ .nogit/
pages/
public/ # artifacts
coverage/ coverage/
.nogit/ public/
pages/
# installs
node_modules/
# caches
.yarn/
.cache/
.rpt2_cache
# builds
dist/
dist_web/
dist_serve/
dist_ts_web/
# custom

View File

@ -1,5 +1,7 @@
# gitzone standard # gitzone ci_default
image: hosttoday/ht-docker-node:npmci image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
variables:
GIT_STRATEGY: clone
cache: cache:
paths: paths:
@ -34,48 +36,11 @@ snyk:
- docker - docker
- notpriv - notpriv
sast:
stage: security
image: registry.gitlab.com/hosttoday/ht-docker-dbase:npmci
variables:
DOCKER_DRIVER: overlay2
allow_failure: true
services:
- docker:stable-dind
script:
- npmci npm prepare
- npmci npm install
- npmci command npm run build
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SAST_CONFIDENCE_LEVEL="${SAST_CONFIDENCE_LEVEL:-3}"
--volume "$PWD:/code"
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/sast:$SP_VERSION" /app/bin/run /code
artifacts:
reports:
sast: gl-sast-report.json
tags:
- docker
- priv
# ==================== # ====================
# test stage # test stage
# ==================== # ====================
testLTS: testStable:
stage: test
script:
- npmci npm prepare
- npmci node install lts
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
testSTABLE:
stage: test stage: test
script: script:
- npmci npm prepare - npmci npm prepare
@ -85,12 +50,24 @@ testSTABLE:
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
- priv
testBuild:
stage: test
script:
- npmci npm prepare
- npmci node install lts
- npmci npm install
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv - notpriv
release: release:
stage: release stage: release
script: script:
- npmci node install stable - npmci node install lts
- npmci npm publish - npmci npm publish
only: only:
- tags - tags
@ -103,19 +80,11 @@ release:
# ==================== # ====================
codequality: codequality:
stage: metadata stage: metadata
image: docker:stable
allow_failure: true allow_failure: true
services:
- docker:stable-dind
script: script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/') - npmci command npm install -g tslint typescript
- docker run - npmci npm install
--env SOURCE_CODE="$PWD" - npmci command "tslint -c tslint.json ./ts/**/*.ts"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts:
paths: [codeclimate.json]
tags: tags:
- docker - docker
- priv - priv
@ -131,13 +100,15 @@ trigger:
- notpriv - notpriv
pages: pages:
image: hosttoday/ht-docker-node:npmci image: hosttoday/ht-docker-dbase:npmci
services:
- docker:18-dind
stage: metadata stage: metadata
script: script:
- npmci command npm install -g typedoc typescript - npmci command npm install -g @gitzone/tsdoc
- npmci npm prepare - npmci npm prepare
- npmci npm install - npmci npm install
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/ - npmci command tsdoc
tags: tags:
- docker - docker
- notpriv - notpriv

View File

@ -38,6 +38,6 @@ Objectmap takes care of keeping track of objects for you.
For further information read the linked docs at the top of this readme. For further information read the linked docs at the top of this readme.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) > MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html) | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://maintainedby.lossless.com) [![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)

1429
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/lik", "name": "@pushrocks/lik",
"version": "3.0.6", "version": "3.0.13",
"private": false, "private": false,
"description": "light little helpers for node", "description": "light little helpers for node",
"main": "dist/index.js", "main": "dist/index.js",
@ -20,21 +20,32 @@
}, },
"homepage": "https://gitlab.com/pushrocks/lik#README", "homepage": "https://gitlab.com/pushrocks/lik#README",
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.3", "@gitzone/tsbuild": "^2.1.17",
"@gitzone/tsrun": "^1.1.17", "@gitzone/tsrun": "^1.2.8",
"@gitzone/tstest": "^1.0.18", "@gitzone/tstest": "^1.0.28",
"@pushrocks/tapbundle": "^3.0.7", "@pushrocks/tapbundle": "^3.2.0",
"@types/node": "^10.12.12", "@types/node": "^12.12.14",
"tslint": "^5.11.0", "tslint": "^5.20.1",
"tslint-config-prettier": "^1.17.0" "tslint-config-prettier": "^1.18.0"
}, },
"dependencies": { "dependencies": {
"@pushrocks/smartdelay": "^2.0.2", "@pushrocks/smartdelay": "^2.0.6",
"@pushrocks/smartpromise": "^2.0.5", "@pushrocks/smartpromise": "^3.0.6",
"@pushrocks/smartrx": "^2.0.3", "@pushrocks/smartrx": "^2.0.5",
"@pushrocks/smarttime": "^3.0.5", "@pushrocks/smarttime": "^3.0.12",
"@types/minimatch": "^3.0.3", "@types/minimatch": "^3.0.3",
"minimatch": "^3.0.4", "minimatch": "^3.0.4",
"symbol-tree": "^3.2.2" "symbol-tree": "^3.2.4"
} },
"files": [
"ts/*",
"ts_web/*",
"dist/*",
"dist_web/*",
"dist_ts_web/*",
"assets/*",
"cli.js",
"npmextra.json",
"readme.md"
]
} }

View File

@ -8,10 +8,10 @@ import * as lik from '../ts/index';
let testTimedAggregator: lik.TimedAggregtor<string>; let testTimedAggregator: lik.TimedAggregtor<string>;
tap.test('should create a timed aggregaotor', async (tools) => { tap.test('should create a timed aggregaotor', async tools => {
testTimedAggregator = new lik.TimedAggregtor<string>({ testTimedAggregator = new lik.TimedAggregtor<string>({
aggregationIntervalInMillis: 1000, aggregationIntervalInMillis: 1000,
functionForAggregation: (aggregation) => { functionForAggregation: aggregation => {
console.log(aggregation); console.log(aggregation);
} }
}); });

View File

@ -14,6 +14,9 @@ export interface IObjectmapFindFunction<T> {
export class Objectmap<T> { export class Objectmap<T> {
private objectArray: T[] = []; private objectArray: T[] = [];
// events
public eventSubject = new plugins.smartrx.rxjs.Subject<any>();
/** /**
* returns a new instance * returns a new instance
*/ */
@ -33,6 +36,7 @@ export class Objectmap<T> {
} else { } else {
// the object is not yet in the objectmap // the object is not yet in the objectmap
this.objectArray.push(objectArg); this.objectArray.push(objectArg);
this.eventSubject.next('add');
return true; return true;
} }
} }
@ -89,7 +93,9 @@ export class Objectmap<T> {
* gets an object in the Observablemap and removes it, so it can't be retrieved again * gets an object in the Observablemap and removes it, so it can't be retrieved again
*/ */
public getOneAndRemove(): T { public getOneAndRemove(): T {
return this.objectArray.shift(); const removedItem = this.objectArray.shift();
this.eventSubject.next('remove');
return removedItem;
} }
/** /**
@ -125,6 +131,7 @@ export class Objectmap<T> {
} }
} }
this.objectArray = replacementArray; this.objectArray = replacementArray;
this.eventSubject.next('remove');
} }
/** /**
@ -132,5 +139,6 @@ export class Objectmap<T> {
*/ */
public wipe() { public wipe() {
this.objectArray = []; this.objectArray = [];
this.eventSubject.next('wiped');
} }
} }

View File

@ -11,11 +11,10 @@ export class TimedAggregtor<T> {
constructor(optionsArg: ITimedAggregatorOptions<T>) { constructor(optionsArg: ITimedAggregatorOptions<T>) {
this.options = optionsArg; this.options = optionsArg;
} }
private aggregationTimer: plugins.smarttime.Timer; private aggregationTimer: plugins.smarttime.Timer;
private checkAggregationStatus () { private checkAggregationStatus() {
const addAggregationTimer = () => { const addAggregationTimer = () => {
this.aggregationTimer = new plugins.smarttime.Timer(this.options.aggregationIntervalInMillis); this.aggregationTimer = new plugins.smarttime.Timer(this.options.aggregationIntervalInMillis);
this.aggregationTimer.completed.then(() => { this.aggregationTimer.completed.then(() => {
@ -39,4 +38,4 @@ export class TimedAggregtor<T> {
this.storageArray.push(aggregationArg); this.storageArray.push(aggregationArg);
this.checkAggregationStatus(); this.checkAggregationStatus();
} }
}; }