@4players/odin-common 2.8.0 → 2.10.0
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/lib/cjs/plugin/api.js
CHANGED
|
@@ -13,7 +13,7 @@ var Backend;
|
|
|
13
13
|
(function (PeerCipherStatus) {
|
|
14
14
|
PeerCipherStatus[PeerCipherStatus["InvalidPassword"] = -1] = "InvalidPassword";
|
|
15
15
|
PeerCipherStatus[PeerCipherStatus["Unknown"] = 0] = "Unknown";
|
|
16
|
-
PeerCipherStatus[PeerCipherStatus["
|
|
16
|
+
PeerCipherStatus[PeerCipherStatus["Unencrypted"] = 1] = "Unencrypted";
|
|
17
17
|
PeerCipherStatus[PeerCipherStatus["Encrypted"] = 2] = "Encrypted";
|
|
18
18
|
})(PeerCipherStatus = Backend.PeerCipherStatus || (Backend.PeerCipherStatus = {}));
|
|
19
19
|
})(Backend || (exports.Backend = Backend = {}));
|
|
@@ -11,15 +11,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Strand = void 0;
|
|
13
13
|
class Strand {
|
|
14
|
-
constructor() {
|
|
14
|
+
constructor(...values) {
|
|
15
15
|
this._Tasks = [];
|
|
16
16
|
this._Running = false;
|
|
17
|
+
this._Values = values;
|
|
17
18
|
}
|
|
18
19
|
enqueue(task) {
|
|
19
20
|
return new Promise((resolve, reject) => {
|
|
20
21
|
const wrapped = () => __awaiter(this, void 0, void 0, function* () {
|
|
21
22
|
try {
|
|
22
|
-
const result = yield task();
|
|
23
|
+
const result = yield task(...this._Values);
|
|
23
24
|
resolve(result);
|
|
24
25
|
}
|
|
25
26
|
catch (error) {
|
package/lib/esm/plugin/api.js
CHANGED
|
@@ -10,7 +10,7 @@ export var Backend;
|
|
|
10
10
|
(function (PeerCipherStatus) {
|
|
11
11
|
PeerCipherStatus[PeerCipherStatus["InvalidPassword"] = -1] = "InvalidPassword";
|
|
12
12
|
PeerCipherStatus[PeerCipherStatus["Unknown"] = 0] = "Unknown";
|
|
13
|
-
PeerCipherStatus[PeerCipherStatus["
|
|
13
|
+
PeerCipherStatus[PeerCipherStatus["Unencrypted"] = 1] = "Unencrypted";
|
|
14
14
|
PeerCipherStatus[PeerCipherStatus["Encrypted"] = 2] = "Encrypted";
|
|
15
15
|
})(PeerCipherStatus = Backend.PeerCipherStatus || (Backend.PeerCipherStatus = {}));
|
|
16
16
|
})(Backend || (Backend = {}));
|
|
@@ -8,15 +8,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
export class Strand {
|
|
11
|
-
constructor() {
|
|
11
|
+
constructor(...values) {
|
|
12
12
|
this._Tasks = [];
|
|
13
13
|
this._Running = false;
|
|
14
|
+
this._Values = values;
|
|
14
15
|
}
|
|
15
16
|
enqueue(task) {
|
|
16
17
|
return new Promise((resolve, reject) => {
|
|
17
18
|
const wrapped = () => __awaiter(this, void 0, void 0, function* () {
|
|
18
19
|
try {
|
|
19
|
-
const result = yield task();
|
|
20
|
+
const result = yield task(...this._Values);
|
|
20
21
|
resolve(result);
|
|
21
22
|
}
|
|
22
23
|
catch (error) {
|
package/lib/plugin/api.d.ts
CHANGED
package/lib/utility/msgpack.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function msgpackEncode(value: unknown):
|
|
2
|
-
export declare function msgpackDecode(buffer:
|
|
1
|
+
export declare function msgpackEncode(value: unknown): Uint8Array;
|
|
2
|
+
export declare function msgpackDecode(buffer: Uint8Array): unknown;
|
package/lib/utility/strand.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export declare class Strand {
|
|
1
|
+
export declare class Strand<T extends unknown[] = []> {
|
|
2
2
|
private readonly _Tasks;
|
|
3
3
|
private _Running;
|
|
4
|
-
|
|
4
|
+
private _Values;
|
|
5
|
+
constructor(...values: T);
|
|
6
|
+
enqueue<U>(task: (...values: T) => Promise<U>): Promise<U>;
|
|
5
7
|
private execute;
|
|
6
8
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4players/odin-common",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"description": "A collection of commonly used type definitions and utility functions across ODIN web projects",
|
|
5
5
|
"author": "Josho Bleicker <josho.bleicker@4players.io> (https://www.4players.io)",
|
|
6
6
|
"homepage": "https://www.4players.io",
|
|
@@ -43,4 +43,4 @@
|
|
|
43
43
|
"testyts": "~1.5.0",
|
|
44
44
|
"typescript": "~5.4.0"
|
|
45
45
|
}
|
|
46
|
-
}
|
|
46
|
+
}
|