@christianriedl/utils 1.0.69 → 1.0.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dummyStorage.d.ts +1 -1
- package/dist/iMarshal.d.ts +29 -0
- package/dist/iMarshal.js +2 -0
- package/dist/iMarshal.js.map +1 -0
- package/dist/iStatistics.d.ts +21 -0
- package/dist/iStatistics.js +2 -0
- package/dist/iStatistics.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/marshalBE.d.ts +36 -0
- package/dist/marshalBE.js +132 -0
- package/dist/marshalBE.js.map +1 -0
- package/dist/marshalLE.d.ts +36 -0
- package/dist/marshalLE.js +132 -0
- package/dist/marshalLE.js.map +1 -0
- package/dist/reactiveStorage.d.ts +1 -1
- package/dist/statistics.d.ts +13 -0
- package/dist/statistics.js +54 -0
- package/dist/statistics.js.map +1 -0
- package/dist/types.d.ts +2 -2
- package/package.json +5 -5
package/dist/dummyStorage.d.ts
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface IMarshal {
|
|
2
|
+
writeBoolean(val: boolean): void;
|
|
3
|
+
writeInt8(val: number): void;
|
|
4
|
+
writeUInt8(val: number): void;
|
|
5
|
+
writeInt16(val: number): void;
|
|
6
|
+
writeUInt16(val: number): void;
|
|
7
|
+
writeInt32(val: number): void;
|
|
8
|
+
writeUInt32(val: number): void;
|
|
9
|
+
writeInt64(val: bigint): void;
|
|
10
|
+
writeUInt64(val: bigint): void;
|
|
11
|
+
writeFloat(val: number): void;
|
|
12
|
+
writeDouble(val: number): void;
|
|
13
|
+
writeString(val: string): void;
|
|
14
|
+
readBoolean(): boolean;
|
|
15
|
+
readInt8(): number;
|
|
16
|
+
readUInt8(): number;
|
|
17
|
+
readInt16(): number;
|
|
18
|
+
readUInt16(): number;
|
|
19
|
+
readInt32(): number;
|
|
20
|
+
readUInt32(): number;
|
|
21
|
+
readInt64(): bigint;
|
|
22
|
+
readUInt64(): bigint;
|
|
23
|
+
readFloat(): number;
|
|
24
|
+
readDouble(): number;
|
|
25
|
+
readString(): string;
|
|
26
|
+
reset(): void;
|
|
27
|
+
remainingRead(): number;
|
|
28
|
+
remainingWrite(): number;
|
|
29
|
+
}
|
package/dist/iMarshal.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iMarshal.js","sourceRoot":"","sources":["../src/iMarshal.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ILogger, LogLevel } from './iLogger';
|
|
2
|
+
import { InjectionKey } from 'vue';
|
|
3
|
+
export declare const statisticsSymbol: InjectionKey<IStatistics>;
|
|
4
|
+
export interface IStatisticsValue {
|
|
5
|
+
key: string;
|
|
6
|
+
category: string;
|
|
7
|
+
name: string;
|
|
8
|
+
id: number;
|
|
9
|
+
currentValue: number;
|
|
10
|
+
maximumValue: number;
|
|
11
|
+
sumValue: number;
|
|
12
|
+
incremented?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface IStatistics {
|
|
15
|
+
getValues(category?: string): IStatisticsValue[];
|
|
16
|
+
searchOrCreate(category: string, name: string): IStatisticsValue;
|
|
17
|
+
reset(resetSum?: boolean, resetMax?: boolean): void;
|
|
18
|
+
increment(value: IStatisticsValue, count?: number): void;
|
|
19
|
+
set(value: IStatisticsValue, num: number): void;
|
|
20
|
+
log(logger: ILogger, level: LogLevel, category?: string): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iStatistics.js","sourceRoot":"","sources":["../src/iStatistics.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,gBAAgB,GAA8B,MAAM,CAAC,YAAY,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './types';
|
|
2
2
|
export * from './iLogger';
|
|
3
|
+
export * from './iMarshal';
|
|
4
|
+
export * from './iStatistics';
|
|
3
5
|
export * from './helper';
|
|
4
6
|
export * from './localStorage';
|
|
5
7
|
export * from './dummyStorage';
|
|
@@ -7,4 +9,7 @@ export * from './registerServiceWorker';
|
|
|
7
9
|
export * from './reactiveStorage';
|
|
8
10
|
export * from './appState';
|
|
9
11
|
export * from './appConfig';
|
|
12
|
+
export * from './statistics';
|
|
13
|
+
export * from './marshalBE';
|
|
14
|
+
export * from './marshalLE';
|
|
10
15
|
export { InjectionKey, Ref, ref, reactive, toRaw, isRef, watchEffect } from 'vue';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './types';
|
|
2
2
|
export * from './iLogger';
|
|
3
|
+
export * from './iMarshal';
|
|
4
|
+
export * from './iStatistics';
|
|
3
5
|
export * from './helper';
|
|
4
6
|
export * from './localStorage';
|
|
5
7
|
export * from './dummyStorage';
|
|
@@ -7,5 +9,8 @@ export * from './registerServiceWorker';
|
|
|
7
9
|
export * from './reactiveStorage';
|
|
8
10
|
export * from './appState';
|
|
9
11
|
export * from './appConfig';
|
|
12
|
+
export * from './statistics';
|
|
13
|
+
export * from './marshalBE';
|
|
14
|
+
export * from './marshalLE';
|
|
10
15
|
export { ref, reactive, toRaw, isRef, watchEffect } from 'vue';
|
|
11
16
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAqB,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAqB,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { IMarshal } from './iMarshal';
|
|
3
|
+
export declare class MarshalBE implements IMarshal {
|
|
4
|
+
_buffer: Buffer;
|
|
5
|
+
_encoding: BufferEncoding;
|
|
6
|
+
_writeOffset: number;
|
|
7
|
+
_readOffset: number;
|
|
8
|
+
constructor(buffer: Buffer, encoding?: BufferEncoding);
|
|
9
|
+
writeBoolean(val: boolean): void;
|
|
10
|
+
writeInt8(val: number): void;
|
|
11
|
+
writeUInt8(val: number): void;
|
|
12
|
+
writeInt16(val: number): void;
|
|
13
|
+
writeUInt16(val: number): void;
|
|
14
|
+
writeInt32(val: number): void;
|
|
15
|
+
writeUInt32(val: number): void;
|
|
16
|
+
writeInt64(val: bigint): void;
|
|
17
|
+
writeUInt64(val: bigint): void;
|
|
18
|
+
writeFloat(val: number): void;
|
|
19
|
+
writeDouble(val: number): void;
|
|
20
|
+
writeString(val: string): void;
|
|
21
|
+
readBoolean(): boolean;
|
|
22
|
+
readInt8(): number;
|
|
23
|
+
readUInt8(): number;
|
|
24
|
+
readInt16(): number;
|
|
25
|
+
readUInt16(): number;
|
|
26
|
+
readInt32(): number;
|
|
27
|
+
readUInt32(): number;
|
|
28
|
+
readInt64(): bigint;
|
|
29
|
+
readUInt64(): bigint;
|
|
30
|
+
readFloat(): number;
|
|
31
|
+
readDouble(): number;
|
|
32
|
+
readString(): string;
|
|
33
|
+
reset(): void;
|
|
34
|
+
remainingRead(): number;
|
|
35
|
+
remainingWrite(): number;
|
|
36
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
// Big Endian marshaller
|
|
2
|
+
export class MarshalBE {
|
|
3
|
+
_buffer;
|
|
4
|
+
_encoding;
|
|
5
|
+
_writeOffset;
|
|
6
|
+
_readOffset;
|
|
7
|
+
constructor(buffer, encoding = 'utf8') {
|
|
8
|
+
this._buffer = buffer;
|
|
9
|
+
this._encoding = encoding;
|
|
10
|
+
this._readOffset = this._writeOffset = 0;
|
|
11
|
+
}
|
|
12
|
+
writeBoolean(val) {
|
|
13
|
+
this.writeInt8(val ? 1 : 0);
|
|
14
|
+
}
|
|
15
|
+
writeInt8(val) {
|
|
16
|
+
this._buffer.writeInt8(val, this._writeOffset);
|
|
17
|
+
this._writeOffset++;
|
|
18
|
+
}
|
|
19
|
+
writeUInt8(val) {
|
|
20
|
+
this._buffer.writeUInt8(val, this._writeOffset);
|
|
21
|
+
this._writeOffset++;
|
|
22
|
+
}
|
|
23
|
+
writeInt16(val) {
|
|
24
|
+
this._buffer.writeInt16BE(val, this._writeOffset);
|
|
25
|
+
this._writeOffset += 2;
|
|
26
|
+
}
|
|
27
|
+
writeUInt16(val) {
|
|
28
|
+
this._buffer.writeUInt16BE(val, this._writeOffset);
|
|
29
|
+
this._writeOffset += 2;
|
|
30
|
+
}
|
|
31
|
+
writeInt32(val) {
|
|
32
|
+
this._buffer.writeInt32BE(val, this._writeOffset);
|
|
33
|
+
this._writeOffset += 4;
|
|
34
|
+
}
|
|
35
|
+
writeUInt32(val) {
|
|
36
|
+
this._buffer.writeUInt32BE(val, this._writeOffset);
|
|
37
|
+
this._writeOffset += 4;
|
|
38
|
+
}
|
|
39
|
+
writeInt64(val) {
|
|
40
|
+
this._buffer.writeBigInt64BE(val, this._writeOffset);
|
|
41
|
+
this._writeOffset += 8;
|
|
42
|
+
}
|
|
43
|
+
writeUInt64(val) {
|
|
44
|
+
this._buffer.writeBigUInt64BE(val, this._writeOffset);
|
|
45
|
+
this._writeOffset += 8;
|
|
46
|
+
}
|
|
47
|
+
writeFloat(val) {
|
|
48
|
+
this._buffer.writeFloatBE(val, this._writeOffset);
|
|
49
|
+
this._writeOffset += 4;
|
|
50
|
+
}
|
|
51
|
+
writeDouble(val) {
|
|
52
|
+
this._buffer.writeDoubleBE(val, this._writeOffset);
|
|
53
|
+
this._writeOffset += 8;
|
|
54
|
+
}
|
|
55
|
+
writeString(val) {
|
|
56
|
+
const byteLength = Buffer.byteLength(val, this._encoding);
|
|
57
|
+
this.writeInt32(byteLength);
|
|
58
|
+
this._buffer.write(val, this._writeOffset, byteLength, this._encoding);
|
|
59
|
+
this._writeOffset += byteLength;
|
|
60
|
+
}
|
|
61
|
+
readBoolean() {
|
|
62
|
+
const val = this._buffer.readInt8(this._readOffset);
|
|
63
|
+
this._readOffset++;
|
|
64
|
+
return val ? true : false;
|
|
65
|
+
}
|
|
66
|
+
readInt8() {
|
|
67
|
+
const val = this._buffer.readInt8(this._readOffset);
|
|
68
|
+
this._readOffset++;
|
|
69
|
+
return val;
|
|
70
|
+
}
|
|
71
|
+
readUInt8() {
|
|
72
|
+
const val = this._buffer.readUInt8(this._readOffset);
|
|
73
|
+
this._readOffset++;
|
|
74
|
+
return val;
|
|
75
|
+
}
|
|
76
|
+
readInt16() {
|
|
77
|
+
const val = this._buffer.readInt16BE(this._readOffset);
|
|
78
|
+
this._readOffset += 2;
|
|
79
|
+
return val;
|
|
80
|
+
}
|
|
81
|
+
readUInt16() {
|
|
82
|
+
const val = this._buffer.readUInt16BE(this._readOffset);
|
|
83
|
+
this._readOffset += 2;
|
|
84
|
+
return val;
|
|
85
|
+
}
|
|
86
|
+
readInt32() {
|
|
87
|
+
const val = this._buffer.readInt32BE(this._readOffset);
|
|
88
|
+
this._readOffset += 4;
|
|
89
|
+
return val;
|
|
90
|
+
}
|
|
91
|
+
readUInt32() {
|
|
92
|
+
const val = this._buffer.readUInt32BE(this._readOffset);
|
|
93
|
+
this._readOffset += 4;
|
|
94
|
+
return val;
|
|
95
|
+
}
|
|
96
|
+
readInt64() {
|
|
97
|
+
const val = this._buffer.readBigInt64BE(this._readOffset);
|
|
98
|
+
this._readOffset += 8;
|
|
99
|
+
return val;
|
|
100
|
+
}
|
|
101
|
+
readUInt64() {
|
|
102
|
+
const val = this._buffer.readBigUInt64BE(this._readOffset);
|
|
103
|
+
this._readOffset += 8;
|
|
104
|
+
return val;
|
|
105
|
+
}
|
|
106
|
+
readFloat() {
|
|
107
|
+
const val = this._buffer.readFloatBE(this._readOffset);
|
|
108
|
+
this._readOffset += 4;
|
|
109
|
+
return val;
|
|
110
|
+
}
|
|
111
|
+
readDouble() {
|
|
112
|
+
const val = this._buffer.readDoubleBE(this._readOffset);
|
|
113
|
+
this._readOffset += 8;
|
|
114
|
+
return val;
|
|
115
|
+
}
|
|
116
|
+
readString() {
|
|
117
|
+
const len = this.readInt32();
|
|
118
|
+
const val = this._buffer.slice(this._readOffset, this._readOffset + len).toString(this._encoding);
|
|
119
|
+
this._readOffset += len;
|
|
120
|
+
return val;
|
|
121
|
+
}
|
|
122
|
+
reset() {
|
|
123
|
+
this._readOffset = this._writeOffset = 0;
|
|
124
|
+
}
|
|
125
|
+
remainingRead() {
|
|
126
|
+
return this._buffer.byteLength - this._readOffset;
|
|
127
|
+
}
|
|
128
|
+
remainingWrite() {
|
|
129
|
+
return this._buffer.byteLength - this._writeOffset;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=marshalBE.js.map
|
|
@@ -0,0 +1 @@
|
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AAC,WAAW,CAAC;IACtD,CAAC;IACD,cAAc;QACV,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC;IACvD,CAAC;CACJ"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { IMarshal } from './iMarshal';
|
|
3
|
+
export declare class MarshalLE implements IMarshal {
|
|
4
|
+
_buffer: Buffer;
|
|
5
|
+
_encoding: BufferEncoding;
|
|
6
|
+
_writeOffset: number;
|
|
7
|
+
_readOffset: number;
|
|
8
|
+
constructor(buffer: Buffer, encoding?: BufferEncoding);
|
|
9
|
+
writeBoolean(val: boolean): void;
|
|
10
|
+
writeInt8(val: number): void;
|
|
11
|
+
writeUInt8(val: number): void;
|
|
12
|
+
writeInt16(val: number): void;
|
|
13
|
+
writeUInt16(val: number): void;
|
|
14
|
+
writeInt32(val: number): void;
|
|
15
|
+
writeUInt32(val: number): void;
|
|
16
|
+
writeInt64(val: bigint): void;
|
|
17
|
+
writeUInt64(val: bigint): void;
|
|
18
|
+
writeFloat(val: number): void;
|
|
19
|
+
writeDouble(val: number): void;
|
|
20
|
+
writeString(val: string): void;
|
|
21
|
+
readBoolean(): boolean;
|
|
22
|
+
readInt8(): number;
|
|
23
|
+
readUInt8(): number;
|
|
24
|
+
readInt16(): number;
|
|
25
|
+
readUInt16(): number;
|
|
26
|
+
readInt32(): number;
|
|
27
|
+
readUInt32(): number;
|
|
28
|
+
readInt64(): bigint;
|
|
29
|
+
readUInt64(): bigint;
|
|
30
|
+
readFloat(): number;
|
|
31
|
+
readDouble(): number;
|
|
32
|
+
readString(): string;
|
|
33
|
+
reset(): void;
|
|
34
|
+
remainingRead(): number;
|
|
35
|
+
remainingWrite(): number;
|
|
36
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
// Big Endian marshaller
|
|
2
|
+
export class MarshalLE {
|
|
3
|
+
_buffer;
|
|
4
|
+
_encoding;
|
|
5
|
+
_writeOffset;
|
|
6
|
+
_readOffset;
|
|
7
|
+
constructor(buffer, encoding = 'utf8') {
|
|
8
|
+
this._buffer = buffer;
|
|
9
|
+
this._encoding = encoding;
|
|
10
|
+
this._readOffset = this._writeOffset = 0;
|
|
11
|
+
}
|
|
12
|
+
writeBoolean(val) {
|
|
13
|
+
this.writeInt8(val ? 1 : 0);
|
|
14
|
+
}
|
|
15
|
+
writeInt8(val) {
|
|
16
|
+
this._buffer.writeInt8(val, this._writeOffset);
|
|
17
|
+
this._writeOffset++;
|
|
18
|
+
}
|
|
19
|
+
writeUInt8(val) {
|
|
20
|
+
this._buffer.writeUInt8(val, this._writeOffset);
|
|
21
|
+
this._writeOffset++;
|
|
22
|
+
}
|
|
23
|
+
writeInt16(val) {
|
|
24
|
+
this._buffer.writeInt16LE(val, this._writeOffset);
|
|
25
|
+
this._writeOffset += 2;
|
|
26
|
+
}
|
|
27
|
+
writeUInt16(val) {
|
|
28
|
+
this._buffer.writeUInt16LE(val, this._writeOffset);
|
|
29
|
+
this._writeOffset += 2;
|
|
30
|
+
}
|
|
31
|
+
writeInt32(val) {
|
|
32
|
+
this._buffer.writeInt32LE(val, this._writeOffset);
|
|
33
|
+
this._writeOffset += 4;
|
|
34
|
+
}
|
|
35
|
+
writeUInt32(val) {
|
|
36
|
+
this._buffer.writeUInt32LE(val, this._writeOffset);
|
|
37
|
+
this._writeOffset += 4;
|
|
38
|
+
}
|
|
39
|
+
writeInt64(val) {
|
|
40
|
+
this._buffer.writeBigInt64LE(val, this._writeOffset);
|
|
41
|
+
this._writeOffset += 8;
|
|
42
|
+
}
|
|
43
|
+
writeUInt64(val) {
|
|
44
|
+
this._buffer.writeBigUInt64LE(val, this._writeOffset);
|
|
45
|
+
this._writeOffset += 8;
|
|
46
|
+
}
|
|
47
|
+
writeFloat(val) {
|
|
48
|
+
this._buffer.writeFloatLE(val, this._writeOffset);
|
|
49
|
+
this._writeOffset += 4;
|
|
50
|
+
}
|
|
51
|
+
writeDouble(val) {
|
|
52
|
+
this._buffer.writeDoubleLE(val, this._writeOffset);
|
|
53
|
+
this._writeOffset += 8;
|
|
54
|
+
}
|
|
55
|
+
writeString(val) {
|
|
56
|
+
const byteLength = Buffer.byteLength(val, this._encoding);
|
|
57
|
+
this.writeInt32(byteLength);
|
|
58
|
+
this._buffer.write(val, this._writeOffset, byteLength, this._encoding);
|
|
59
|
+
this._writeOffset += byteLength;
|
|
60
|
+
}
|
|
61
|
+
readBoolean() {
|
|
62
|
+
const val = this._buffer.readInt8(this._readOffset);
|
|
63
|
+
this._readOffset++;
|
|
64
|
+
return val ? true : false;
|
|
65
|
+
}
|
|
66
|
+
readInt8() {
|
|
67
|
+
const val = this._buffer.readInt8(this._readOffset);
|
|
68
|
+
this._readOffset++;
|
|
69
|
+
return val;
|
|
70
|
+
}
|
|
71
|
+
readUInt8() {
|
|
72
|
+
const val = this._buffer.readUInt8(this._readOffset);
|
|
73
|
+
this._readOffset++;
|
|
74
|
+
return val;
|
|
75
|
+
}
|
|
76
|
+
readInt16() {
|
|
77
|
+
const val = this._buffer.readInt16LE(this._readOffset);
|
|
78
|
+
this._readOffset += 2;
|
|
79
|
+
return val;
|
|
80
|
+
}
|
|
81
|
+
readUInt16() {
|
|
82
|
+
const val = this._buffer.readUInt16LE(this._readOffset);
|
|
83
|
+
this._readOffset += 2;
|
|
84
|
+
return val;
|
|
85
|
+
}
|
|
86
|
+
readInt32() {
|
|
87
|
+
const val = this._buffer.readInt32LE(this._readOffset);
|
|
88
|
+
this._readOffset += 4;
|
|
89
|
+
return val;
|
|
90
|
+
}
|
|
91
|
+
readUInt32() {
|
|
92
|
+
const val = this._buffer.readUInt32LE(this._readOffset);
|
|
93
|
+
this._readOffset += 4;
|
|
94
|
+
return val;
|
|
95
|
+
}
|
|
96
|
+
readInt64() {
|
|
97
|
+
const val = this._buffer.readBigInt64LE(this._readOffset);
|
|
98
|
+
this._readOffset += 8;
|
|
99
|
+
return val;
|
|
100
|
+
}
|
|
101
|
+
readUInt64() {
|
|
102
|
+
const val = this._buffer.readBigUInt64LE(this._readOffset);
|
|
103
|
+
this._readOffset += 8;
|
|
104
|
+
return val;
|
|
105
|
+
}
|
|
106
|
+
readFloat() {
|
|
107
|
+
const val = this._buffer.readFloatLE(this._readOffset);
|
|
108
|
+
this._readOffset += 4;
|
|
109
|
+
return val;
|
|
110
|
+
}
|
|
111
|
+
readDouble() {
|
|
112
|
+
const val = this._buffer.readDoubleLE(this._readOffset);
|
|
113
|
+
this._readOffset += 8;
|
|
114
|
+
return val;
|
|
115
|
+
}
|
|
116
|
+
readString() {
|
|
117
|
+
const len = this.readInt32();
|
|
118
|
+
const val = this._buffer.slice(this._readOffset, this._readOffset + len).toString(this._encoding);
|
|
119
|
+
this._readOffset += len;
|
|
120
|
+
return val;
|
|
121
|
+
}
|
|
122
|
+
reset() {
|
|
123
|
+
this._readOffset = this._writeOffset = 0;
|
|
124
|
+
}
|
|
125
|
+
remainingRead() {
|
|
126
|
+
return this._buffer.byteLength - this._readOffset;
|
|
127
|
+
}
|
|
128
|
+
remainingWrite() {
|
|
129
|
+
return this._buffer.byteLength - this._writeOffset;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=marshalLE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marshalLE.js","sourceRoot":"","sources":["../src/marshalLE.ts"],"names":[],"mappings":"AAEA,wBAAwB;AACxB,MAAM,OAAO,SAAS;IAClB,OAAO,CAAS;IAChB,SAAS,CAAiB;IAC1B,YAAY,CAAS;IACrB,WAAW,CAAS;IACpB,YAAY,MAAc,EAAE,WAA2B,MAAM;QACzD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;IAC7C,CAAC;IACD,YAAY,CAAC,GAAY;QACrB,IAAI,CAAC,SAAS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GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACvD,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC;QACtB,OAAO,GAAG,CAAC;IACf,CAAC;IACD,UAAU;QACN,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACxD,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC;QACtB,OAAO,GAAG,CAAC;IACf,CAAC;IACD,UAAU;QACN,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAC7B,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAClG,IAAI,CAAC,WAAW,IAAI,GAAG,CAAC;QACxB,OAAO,GAAG,CAAC;IACf,CAAC;IACD,KAAK;QACD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;IAC7C,CAAC;IACD,aAAa;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC;IACtD,CAAC;IACD,cAAc;QACV,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC;IACvD,CAAC;CACJ"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IStatisticsValue, IStatistics } from './iStatistics';
|
|
2
|
+
import { Dictionary } from './types';
|
|
3
|
+
import { ILogger, LogLevel } from './iLogger';
|
|
4
|
+
export declare class Statistics implements IStatistics {
|
|
5
|
+
values: Dictionary<IStatisticsValue>;
|
|
6
|
+
valueCount: number;
|
|
7
|
+
getValues(category?: string): IStatisticsValue[];
|
|
8
|
+
searchOrCreate(category: string, name: string): IStatisticsValue;
|
|
9
|
+
reset(resetSum?: boolean, resetMax?: boolean): void;
|
|
10
|
+
increment(value: IStatisticsValue, count?: number): void;
|
|
11
|
+
set(value: IStatisticsValue, num: number): void;
|
|
12
|
+
log(logger: ILogger, level: LogLevel, category?: string): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export class Statistics {
|
|
2
|
+
values = {};
|
|
3
|
+
valueCount = 0;
|
|
4
|
+
getValues(category) {
|
|
5
|
+
const values = [];
|
|
6
|
+
for (const key in this.values) {
|
|
7
|
+
const value = this.values[key];
|
|
8
|
+
if (category && category != value.category)
|
|
9
|
+
continue;
|
|
10
|
+
values.push(value);
|
|
11
|
+
}
|
|
12
|
+
values.sort((a, b) => a.key.localeCompare(b.key));
|
|
13
|
+
return values;
|
|
14
|
+
}
|
|
15
|
+
searchOrCreate(category, name) {
|
|
16
|
+
const key = category + ';' + name;
|
|
17
|
+
let value = this.values[key];
|
|
18
|
+
if (!value) {
|
|
19
|
+
value = { key: key, category: category, name: name, id: this.valueCount++, currentValue: 0, maximumValue: 0, sumValue: 0 };
|
|
20
|
+
this.values[key] = value;
|
|
21
|
+
}
|
|
22
|
+
return value;
|
|
23
|
+
}
|
|
24
|
+
reset(resetSum, resetMax) {
|
|
25
|
+
for (const key in this.values) {
|
|
26
|
+
const value = this.values[key];
|
|
27
|
+
if (value.incremented)
|
|
28
|
+
value.currentValue = 0;
|
|
29
|
+
if (resetMax)
|
|
30
|
+
value.currentValue = value.maximumValue = 0;
|
|
31
|
+
if (resetSum)
|
|
32
|
+
value.currentValue = value.sumValue = 0;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
increment(value, count) {
|
|
36
|
+
if (!count)
|
|
37
|
+
count = 1;
|
|
38
|
+
this.set(value, value.currentValue + count);
|
|
39
|
+
value.sumValue += count;
|
|
40
|
+
}
|
|
41
|
+
set(value, num) {
|
|
42
|
+
value.currentValue = num;
|
|
43
|
+
if (num > value.maximumValue)
|
|
44
|
+
value.maximumValue = num;
|
|
45
|
+
}
|
|
46
|
+
log(logger, level, category) {
|
|
47
|
+
const values = this.getValues(category);
|
|
48
|
+
for (let i = 0; i < values.length; i++) {
|
|
49
|
+
const value = values[i];
|
|
50
|
+
logger.log(level, `${value.category}.${value.name} : C:${value.currentValue} M:${value.maximumValue} S:${value.sumValue}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=statistics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statistics.js","sourceRoot":"","sources":["../src/statistics.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,UAAU;IACnB,MAAM,GAAsC,EAAE,CAAC;IAC/C,UAAU,GAAW,CAAC,CAAC;IAEvB,SAAS,CAAC,QAAiB;QACvB,MAAM,MAAM,GAAuB,EAAE,CAAC;QACtC,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE;YAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC/B,IAAI,QAAQ,IAAI,QAAQ,IAAI,KAAK,CAAC,QAAQ;gBACtC,SAAS;YACb,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACtB;QACD,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAClD,OAAO,MAAM,CAAC;IAClB,CAAC;IACD,cAAc,CAAC,QAAgB,EAAE,IAAY;QACzC,MAAM,GAAG,GAAG,QAAQ,GAAG,GAAG,GAAG,IAAI,CAAC;QAClC,IAAI,KAAK,GAAqB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC/C,IAAI,CAAC,KAAK,EAAE;YACR,KAAK,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,I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AE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACpC,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACxB,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,QAAQ,KAAK,CAAC,YAAY,MAAM,KAAK,CAAC,YAAY,MAAM,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;SAC9H;IACL,CAAC;CACJ"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ILocalStorage } from './iLocalStorage';
|
|
2
2
|
import { LogLevel, ILogger } from './iLogger';
|
|
3
3
|
import { Ref, InjectionKey } from 'vue';
|
|
4
|
-
export
|
|
4
|
+
export type Dictionary<T> = {
|
|
5
5
|
[key: string]: T;
|
|
6
6
|
};
|
|
7
7
|
export declare const appConfigSymbol: InjectionKey<IAppConfig>;
|
|
@@ -91,7 +91,7 @@ export interface IAppState extends IAppInfo {
|
|
|
91
91
|
log(logger: ILogger, logLevel: LogLevel): void;
|
|
92
92
|
watch(logger: ILogger, logLevel: LogLevel): void;
|
|
93
93
|
}
|
|
94
|
-
export
|
|
94
|
+
export type ItemType = string | number | boolean;
|
|
95
95
|
export interface IConfigItem {
|
|
96
96
|
name: string;
|
|
97
97
|
description: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@christianriedl/utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.71",
|
|
4
4
|
"description": "Interfaces, local storage, service worker, configuration, application state",
|
|
5
5
|
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"author": "Christian Riedl",
|
|
19
19
|
"license": "ISC",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vue": "^3.2.
|
|
21
|
+
"vue": "^3.2.45"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@vue/cli-plugin-typescript": "^5.0.
|
|
25
|
-
"typescript": "^4.
|
|
26
|
-
"@types/node": "^
|
|
24
|
+
"@vue/cli-plugin-typescript": "^5.0.8",
|
|
25
|
+
"typescript": "^4.9.4",
|
|
26
|
+
"@types/node": "^18.11.18"
|
|
27
27
|
}
|
|
28
28
|
}
|