@bbn/bbn 2.0.249 → 2.0.252
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/bbn.js +1 -1
- package/dist/bbn.js.map +1 -1
- package/dist/bbn.sw.js +1 -1
- package/dist/bbn.sw.js.map +1 -1
- package/dist/db/classes/Center.js +3 -1
- package/dist/db/classes/Object.js +3 -1
- package/dist/db/functions/transactionDone.js +8 -2
- package/dist/fn/datetime/fdate.d.ts +2 -2
- package/dist/fn/datetime/fdate.js +9 -3
- package/dist/worker/Client.js +2 -2
- package/package.json +1 -1
|
@@ -18,13 +18,15 @@ export default class bbnDbCenter {
|
|
|
18
18
|
}
|
|
19
19
|
const database = command.database;
|
|
20
20
|
this.queues[database] = (this.queues[database] || Promise.resolve())
|
|
21
|
-
.catch(() =>
|
|
21
|
+
.catch((e) => console.log(e))
|
|
22
22
|
.then(async () => {
|
|
23
23
|
try {
|
|
24
24
|
const result = await this.execute(command);
|
|
25
25
|
this.postSuccess(port, command.id, result);
|
|
26
26
|
}
|
|
27
27
|
catch (error) {
|
|
28
|
+
throw error;
|
|
29
|
+
console.log(error || "NO ERROR?!");
|
|
28
30
|
this.postError(port, command.id, this.serializeError(error) + ` - DATA: ${JSON.stringify(command)}`);
|
|
29
31
|
}
|
|
30
32
|
});
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
export default function transactionDone(tx) {
|
|
2
2
|
return new Promise((resolve, reject) => {
|
|
3
3
|
tx.oncomplete = () => resolve();
|
|
4
|
-
tx.onabort = () =>
|
|
5
|
-
|
|
4
|
+
tx.onabort = () => {
|
|
5
|
+
console.log(tx.error);
|
|
6
|
+
reject(tx.error);
|
|
7
|
+
};
|
|
8
|
+
tx.onerror = () => {
|
|
9
|
+
console.log(tx.error);
|
|
10
|
+
reject(tx.error);
|
|
11
|
+
};
|
|
6
12
|
});
|
|
7
13
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @global
|
|
5
5
|
* @memberof bbn.fn
|
|
6
6
|
* @param {String|Date} d
|
|
7
|
-
* @param {String} wrong_result
|
|
7
|
+
* @param {String|Boolean} wrong_result
|
|
8
8
|
* @returns
|
|
9
9
|
*/
|
|
10
|
-
export default function fdate(d: any, wrong_result?: boolean):
|
|
10
|
+
export default function fdate(d: any, wrong_result?: boolean): string;
|
|
@@ -6,18 +6,24 @@ import isString from '../type/isString.js';
|
|
|
6
6
|
* @global
|
|
7
7
|
* @memberof bbn.fn
|
|
8
8
|
* @param {String|Date} d
|
|
9
|
-
* @param {String} wrong_result
|
|
9
|
+
* @param {String|Boolean} wrong_result
|
|
10
10
|
* @returns
|
|
11
11
|
*/
|
|
12
12
|
export default function fdate(d, wrong_result = false) {
|
|
13
|
-
let r
|
|
13
|
+
let r;
|
|
14
|
+
try {
|
|
15
|
+
r = dt(d);
|
|
16
|
+
}
|
|
17
|
+
catch (e) {
|
|
18
|
+
r = { isValid: false };
|
|
19
|
+
}
|
|
14
20
|
let time = false;
|
|
15
21
|
// Retro compatibility
|
|
16
22
|
if (wrong_result === true) {
|
|
17
23
|
time = true;
|
|
18
24
|
}
|
|
19
25
|
if (!r.isValid) {
|
|
20
|
-
return wrong_result && isString(wrong_result) ? wrong_result : '';
|
|
26
|
+
return (wrong_result && isString(wrong_result) ? wrong_result : '');
|
|
21
27
|
}
|
|
22
28
|
return r.fdate(false, time);
|
|
23
29
|
}
|
package/dist/worker/Client.js
CHANGED
|
@@ -33,7 +33,7 @@ export default class bbnWorkerClient {
|
|
|
33
33
|
};
|
|
34
34
|
w.port.start();
|
|
35
35
|
w.port.onmessage = event => {
|
|
36
|
-
console.log('Received message from SharedWorker: ' + JSON.stringify(event.data));
|
|
36
|
+
//console.log('Received message from SharedWorker: ' + JSON.stringify(event.data));
|
|
37
37
|
for (const listener of this.listeners) {
|
|
38
38
|
try {
|
|
39
39
|
listener(event.data, event);
|
|
@@ -52,7 +52,7 @@ export default class bbnWorkerClient {
|
|
|
52
52
|
try {
|
|
53
53
|
this.worker.port.postMessage(message, ports);
|
|
54
54
|
if (!('database' in message)) {
|
|
55
|
-
console.log('Sent message to SharedWorker: ' + JSON.stringify(message));
|
|
55
|
+
//console.log('Sent message to SharedWorker: ' + JSON.stringify(message));
|
|
56
56
|
}
|
|
57
57
|
return true;
|
|
58
58
|
}
|