hyoo_sync_client 0.0.526 → 0.0.527
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/node.d.ts +1 -6
- package/node.d.ts.map +1 -1
- package/node.js.map +1 -1
- package/node.test.js +81 -6
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.d.ts +1 -6
- package/web.d.ts.map +1 -1
- package/web.js.map +1 -1
- package/web.test.js +81 -6
- package/web.test.js.map +1 -1
package/node.test.js
CHANGED
|
@@ -6691,6 +6691,81 @@ var $;
|
|
|
6691
6691
|
});
|
|
6692
6692
|
})($ || ($ = {}));
|
|
6693
6693
|
|
|
6694
|
+
;
|
|
6695
|
+
"use strict";
|
|
6696
|
+
var $;
|
|
6697
|
+
(function ($) {
|
|
6698
|
+
class $mol_after_work extends $mol_object2 {
|
|
6699
|
+
delay;
|
|
6700
|
+
task;
|
|
6701
|
+
id;
|
|
6702
|
+
constructor(delay, task) {
|
|
6703
|
+
super();
|
|
6704
|
+
this.delay = delay;
|
|
6705
|
+
this.task = task;
|
|
6706
|
+
this.id = requestIdleCallback(task, { timeout: delay });
|
|
6707
|
+
}
|
|
6708
|
+
destructor() {
|
|
6709
|
+
cancelIdleCallback(this.id);
|
|
6710
|
+
}
|
|
6711
|
+
}
|
|
6712
|
+
$.$mol_after_work = $mol_after_work;
|
|
6713
|
+
if (typeof requestIdleCallback !== 'function') {
|
|
6714
|
+
$.$mol_after_work = $mol_after_timeout;
|
|
6715
|
+
}
|
|
6716
|
+
})($ || ($ = {}));
|
|
6717
|
+
|
|
6718
|
+
;
|
|
6719
|
+
"use strict";
|
|
6720
|
+
var $;
|
|
6721
|
+
(function ($_1) {
|
|
6722
|
+
$mol_test_mocks.push($ => {
|
|
6723
|
+
$.$mol_after_work = $mol_after_mock_timeout;
|
|
6724
|
+
});
|
|
6725
|
+
})($ || ($ = {}));
|
|
6726
|
+
|
|
6727
|
+
;
|
|
6728
|
+
"use strict";
|
|
6729
|
+
var $;
|
|
6730
|
+
(function ($) {
|
|
6731
|
+
function $mol_wait_rest_async() {
|
|
6732
|
+
return new Promise(done => {
|
|
6733
|
+
new this.$mol_after_work(16, () => done(null));
|
|
6734
|
+
});
|
|
6735
|
+
}
|
|
6736
|
+
$.$mol_wait_rest_async = $mol_wait_rest_async;
|
|
6737
|
+
function $mol_wait_rest() {
|
|
6738
|
+
return this.$mol_wire_sync(this).$mol_wait_rest_async();
|
|
6739
|
+
}
|
|
6740
|
+
$.$mol_wait_rest = $mol_wait_rest;
|
|
6741
|
+
})($ || ($ = {}));
|
|
6742
|
+
|
|
6743
|
+
;
|
|
6744
|
+
"use strict";
|
|
6745
|
+
var $;
|
|
6746
|
+
(function ($_1) {
|
|
6747
|
+
var $$;
|
|
6748
|
+
(function ($$) {
|
|
6749
|
+
$mol_test_mocks.push($ => {
|
|
6750
|
+
$.$mol_wait_timeout = function $mol_wait_timeout_mock(timeout) { };
|
|
6751
|
+
$.$mol_wait_timeout_async = async function $mol_wait_timeout_async_mock(timeout) { };
|
|
6752
|
+
});
|
|
6753
|
+
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
6754
|
+
})($ || ($ = {}));
|
|
6755
|
+
|
|
6756
|
+
;
|
|
6757
|
+
"use strict";
|
|
6758
|
+
var $;
|
|
6759
|
+
(function ($_1) {
|
|
6760
|
+
var $$;
|
|
6761
|
+
(function ($$) {
|
|
6762
|
+
$mol_test_mocks.push($ => {
|
|
6763
|
+
$.$mol_wait_rest = function $mol_wait_rest_mock() { };
|
|
6764
|
+
$.$mol_wait_rest_async = async function $mol_wait_rest_async_mock() { };
|
|
6765
|
+
});
|
|
6766
|
+
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
6767
|
+
})($ || ($ = {}));
|
|
6768
|
+
|
|
6694
6769
|
;
|
|
6695
6770
|
"use strict";
|
|
6696
6771
|
var $;
|
|
@@ -6713,7 +6788,7 @@ var $;
|
|
|
6713
6788
|
static last = [];
|
|
6714
6789
|
static send(next) {
|
|
6715
6790
|
$mol_wire_sync(this.first).push(next);
|
|
6716
|
-
|
|
6791
|
+
$$.$mol_wait_timeout(0);
|
|
6717
6792
|
this.last.push(next);
|
|
6718
6793
|
}
|
|
6719
6794
|
}
|
|
@@ -6722,15 +6797,15 @@ var $;
|
|
|
6722
6797
|
const promise = name('jin');
|
|
6723
6798
|
$.$mol_after_mock_warp();
|
|
6724
6799
|
await promise;
|
|
6725
|
-
$
|
|
6726
|
-
$
|
|
6800
|
+
$mol_assert_equal(NameLogger.first, ['john', 'jin']);
|
|
6801
|
+
$mol_assert_equal(NameLogger.last, ['jin']);
|
|
6727
6802
|
},
|
|
6728
6803
|
async 'Latest function calls wins'($) {
|
|
6729
6804
|
const first = [];
|
|
6730
6805
|
const last = [];
|
|
6731
6806
|
function send_name(next) {
|
|
6732
6807
|
$mol_wire_sync(first).push(next);
|
|
6733
|
-
|
|
6808
|
+
$$.$mol_wait_timeout(0);
|
|
6734
6809
|
last.push(next);
|
|
6735
6810
|
}
|
|
6736
6811
|
const name = $mol_wire_async(send_name);
|
|
@@ -6738,8 +6813,8 @@ var $;
|
|
|
6738
6813
|
const promise = name('jin');
|
|
6739
6814
|
$.$mol_after_mock_warp();
|
|
6740
6815
|
await promise;
|
|
6741
|
-
$
|
|
6742
|
-
$
|
|
6816
|
+
$mol_assert_equal(first, ['john', 'jin']);
|
|
6817
|
+
$mol_assert_equal(last, ['jin']);
|
|
6743
6818
|
},
|
|
6744
6819
|
});
|
|
6745
6820
|
})($ || ($ = {}));
|