qword 1.1.3 → 1.1.5
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/ChangeLog +11 -0
- package/client/editor.spec.js +2 -5
- package/client/loadremote.js +10 -13
- package/dist/qword.js +1 -1
- package/dist/qword.js.map +1 -1
- package/dist-dev/qword.js +1 -1
- package/package.json +1 -1
package/ChangeLog
CHANGED
package/client/editor.spec.js
CHANGED
|
@@ -287,14 +287,11 @@ test('Editor: addListener is alias for on', (t) => {
|
|
|
287
287
|
t.end();
|
|
288
288
|
});
|
|
289
289
|
|
|
290
|
-
test('Editor: emit calls registered handler',
|
|
290
|
+
test('Editor: emit calls registered handler', (t) => {
|
|
291
291
|
const editor = makeEditor();
|
|
292
292
|
let received = null;
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
received = value;
|
|
293
|
+
editor.on('custom', (value) => { received = value; });
|
|
296
294
|
editor.emit('custom', 'hello');
|
|
297
|
-
|
|
298
295
|
t.equal(received, 'hello');
|
|
299
296
|
t.end();
|
|
300
297
|
});
|
package/client/loadremote.js
CHANGED
|
@@ -14,11 +14,11 @@ export const loadOptions = once(async (prefix) => {
|
|
|
14
14
|
return await load.json(url);
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
const on = async (remote) => {
|
|
17
|
+
const on = async ({remote, local}) => {
|
|
18
18
|
const [error] = await tryToCatch(load.parallel, remote);
|
|
19
19
|
|
|
20
20
|
if (error)
|
|
21
|
-
await off();
|
|
21
|
+
await off(local);
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
const off = async function(local) {
|
|
@@ -59,22 +59,19 @@ export default async (name, options = {}) => {
|
|
|
59
59
|
local = [module.local];
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
local =
|
|
62
|
+
local = local.map((url) => prefix + url);
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const remote = [];
|
|
69
|
-
|
|
70
|
-
for (const tmpl of remoteTmpls) {
|
|
71
|
-
remote.push(tmpl.replace(/{{\sversion\s}}/g, version));
|
|
72
|
-
}
|
|
64
|
+
const remote = remoteTmpls.map((tmpl) => {
|
|
65
|
+
return tmpl.replace(/{{\s*version\s*}}/g, version);
|
|
66
|
+
});
|
|
73
67
|
|
|
74
68
|
if (!online)
|
|
75
69
|
return await off(local);
|
|
76
70
|
|
|
77
|
-
await on(
|
|
71
|
+
await on({
|
|
72
|
+
remote,
|
|
73
|
+
local,
|
|
74
|
+
});
|
|
78
75
|
};
|
|
79
76
|
|
|
80
77
|
function binom(name, array) {
|