mol_wire_lib 1.0.829 → 1.0.831
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.deps.json +1 -1
- package/node.js +3 -1
- package/node.js.map +1 -1
- package/node.mjs +3 -1
- package/node.test.js +8 -1
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.deps.json +1 -1
- package/web.js +3 -1
- package/web.js.map +1 -1
- package/web.mjs +3 -1
- package/web.test.js +5 -0
- package/web.test.js.map +1 -1
package/web.mjs
CHANGED
|
@@ -623,7 +623,7 @@ var $;
|
|
|
623
623
|
var $;
|
|
624
624
|
(function ($) {
|
|
625
625
|
function $mol_promise_like(val) {
|
|
626
|
-
return val && typeof val.then === 'function';
|
|
626
|
+
return val && typeof val === 'object' && 'then' in val && typeof val.then === 'function';
|
|
627
627
|
}
|
|
628
628
|
$.$mol_promise_like = $mol_promise_like;
|
|
629
629
|
})($ || ($ = {}));
|
|
@@ -1081,6 +1081,8 @@ var $;
|
|
|
1081
1081
|
return value;
|
|
1082
1082
|
if (value instanceof RegExp)
|
|
1083
1083
|
return value.toString();
|
|
1084
|
+
if (value instanceof Uint8Array)
|
|
1085
|
+
return [...value];
|
|
1084
1086
|
let key = $.$mol_key_store.get(value);
|
|
1085
1087
|
if (key)
|
|
1086
1088
|
return key;
|
package/web.test.js
CHANGED
|
@@ -1231,6 +1231,11 @@ var $;
|
|
|
1231
1231
|
$mol_assert_equal($mol_key({ foo: 0 }), '{"foo":0}');
|
|
1232
1232
|
$mol_assert_equal($mol_key({ foo: [false] }), '{"foo":[false]}');
|
|
1233
1233
|
},
|
|
1234
|
+
'Uint8Array'() {
|
|
1235
|
+
$mol_assert_equal($mol_key(new Uint8Array([1, 2])), '[1,2]');
|
|
1236
|
+
$mol_assert_equal($mol_key([new Uint8Array([1, 2])]), '[[1,2]]');
|
|
1237
|
+
$mol_assert_equal($mol_key({ foo: new Uint8Array([1, 2]) }), '{"foo":[1,2]}');
|
|
1238
|
+
},
|
|
1234
1239
|
'Function'() {
|
|
1235
1240
|
const func = () => { };
|
|
1236
1241
|
$mol_assert_equal($mol_key(func), $mol_key(func));
|