@agoric/store 0.9.3-dev-dd19d79.0 → 0.9.3-dev-d589873.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/store",
|
|
3
|
-
"version": "0.9.3-dev-
|
|
3
|
+
"version": "0.9.3-dev-d589873.0+d589873",
|
|
4
4
|
"description": "Wrapper for JavaScript map",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
},
|
|
31
31
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@agoric/assert": "0.6.1-dev-
|
|
33
|
+
"@agoric/assert": "0.6.1-dev-d589873.0+d589873",
|
|
34
34
|
"@endo/exo": "^0.2.2",
|
|
35
35
|
"@endo/marshal": "^0.8.5",
|
|
36
36
|
"@endo/pass-style": "^0.1.3",
|
|
37
37
|
"@endo/patterns": "^0.2.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@agoric/swingset-vat": "0.32.3-dev-
|
|
41
|
-
"@agoric/time": "0.3.3-dev-
|
|
40
|
+
"@agoric/swingset-vat": "0.32.3-dev-d589873.0+d589873",
|
|
41
|
+
"@agoric/time": "0.3.3-dev-d589873.0+d589873",
|
|
42
42
|
"@endo/ses-ava": "^0.2.40",
|
|
43
43
|
"ava": "^5.3.0"
|
|
44
44
|
},
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
],
|
|
57
57
|
"timeout": "2m"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "d5898733a61b253fae863e4ad5531d9005cdacb0"
|
|
60
60
|
}
|
package/src/index.js
CHANGED
|
@@ -56,7 +56,7 @@ export { makeScalarSetStore } from './stores/scalarSetStore.js';
|
|
|
56
56
|
export { makeScalarWeakMapStore } from './stores/scalarWeakMapStore.js';
|
|
57
57
|
export { makeScalarMapStore } from './stores/scalarMapStore.js';
|
|
58
58
|
|
|
59
|
-
export { provideLazy } from './stores/store-utils.js';
|
|
59
|
+
export { provideLazy, isCopyMap, isCopySet } from './stores/store-utils.js';
|
|
60
60
|
|
|
61
61
|
// /////////////////////// Deprecated Legacy ///////////////////////////////////
|
|
62
62
|
|
|
@@ -58,8 +58,12 @@ export const makeWeakMapStoreMethods = (
|
|
|
58
58
|
},
|
|
59
59
|
|
|
60
60
|
addAll: entries => {
|
|
61
|
-
if (
|
|
62
|
-
entries
|
|
61
|
+
if (typeof entries[Symbol.iterator] !== 'function') {
|
|
62
|
+
if (Object.isFrozen(entries) && isCopyMap(entries)) {
|
|
63
|
+
entries = getCopyMapEntries(entries);
|
|
64
|
+
} else {
|
|
65
|
+
Fail`provided data source is not iterable: ${entries}`;
|
|
66
|
+
}
|
|
63
67
|
}
|
|
64
68
|
for (const [key, value] of /** @type {Iterable<[K, V]>} */ (entries)) {
|
|
65
69
|
// Don't assert that the key either does or does not exist.
|
|
@@ -42,8 +42,12 @@ export const makeWeakSetStoreMethods = (
|
|
|
42
42
|
},
|
|
43
43
|
|
|
44
44
|
addAll: keys => {
|
|
45
|
-
if (
|
|
46
|
-
keys
|
|
45
|
+
if (typeof keys[Symbol.iterator] !== 'function') {
|
|
46
|
+
if (Object.isFrozen(keys) && isCopySet(keys)) {
|
|
47
|
+
keys = getCopySetKeys(keys);
|
|
48
|
+
} else {
|
|
49
|
+
Fail`provided data source is not iterable: ${keys}`;
|
|
50
|
+
}
|
|
47
51
|
}
|
|
48
52
|
for (const key of /** @type {Iterable<K>} */ (keys)) {
|
|
49
53
|
assertKeyOkToAdd(key);
|