@agoric/store 0.9.3-u19.0 → 0.9.3-u21.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,21 +1,21 @@
1
1
  {
2
2
  "name": "@agoric/store",
3
- "version": "0.9.3-u19.0",
3
+ "version": "0.9.3-u21.0",
4
4
  "description": "Wrapper for JavaScript map",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
7
7
  "engines": {
8
- "node": "^18.12 || ^20.9"
8
+ "node": "^20.9 || ^22.11"
9
9
  },
10
10
  "scripts": {
11
11
  "build": "exit 0",
12
12
  "test": "ava",
13
13
  "test:xs": "exit 0",
14
14
  "lint-fix": "yarn lint:eslint --fix",
15
- "lint": "run-s --continue-on-error lint:*",
16
- "lint:types": "tsc",
17
- "lint:eslint": "eslint .",
18
- "prepack": "tsc --build tsconfig.build.json",
15
+ "lint": "yarn run -T run-s --continue-on-error 'lint:*'",
16
+ "lint:types": "yarn run -T tsc",
17
+ "lint:eslint": "yarn run -T eslint .",
18
+ "prepack": "yarn run -T tsc --build tsconfig.build.json",
19
19
  "postpack": "git clean -f '*.d.ts*' '*.tsbuildinfo'"
20
20
  },
21
21
  "repository": {
@@ -32,15 +32,15 @@
32
32
  },
33
33
  "homepage": "https://github.com/Agoric/agoric-sdk#readme",
34
34
  "dependencies": {
35
- "@endo/errors": "^1.2.9",
36
- "@endo/exo": "^1.5.8",
37
- "@endo/marshal": "^1.6.3",
38
- "@endo/pass-style": "^1.4.8",
39
- "@endo/patterns": "^1.4.8"
35
+ "@endo/errors": "^1.2.10",
36
+ "@endo/exo": "^1.5.9",
37
+ "@endo/marshal": "^1.6.4",
38
+ "@endo/pass-style": "^1.5.0",
39
+ "@endo/patterns": "^1.5.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@endo/init": "^1.1.8",
43
- "@endo/ses-ava": "^1.2.9",
42
+ "@endo/init": "^1.1.9",
43
+ "@endo/ses-ava": "^1.2.10",
44
44
  "ava": "^5.3.0"
45
45
  },
46
46
  "files": [
@@ -61,7 +61,7 @@
61
61
  "timeout": "2m"
62
62
  },
63
63
  "typeCoverage": {
64
- "atLeast": 89.69
64
+ "atLeast": 89.62
65
65
  },
66
- "gitHead": "29e9704c375a06bb617027093b30d2d25faa6471"
66
+ "gitHead": "e4dd46857133403d584bcf822a81817b355532f9"
67
67
  }
package/src/index.d.ts CHANGED
@@ -2,13 +2,13 @@ export { makeScalarWeakSetStore } from "./stores/scalarWeakSetStore.js";
2
2
  export { makeScalarSetStore } from "./stores/scalarSetStore.js";
3
3
  export { makeScalarWeakMapStore } from "./stores/scalarWeakMapStore.js";
4
4
  export { makeScalarMapStore } from "./stores/scalarMapStore.js";
5
- export { provideLazy } from "./stores/store-utils.js";
6
5
  /** @type {MustMatch} */
7
6
  export const mustMatch: MustMatch;
8
7
  export { makeLegacyMap } from "./legacy/legacyMap.js";
9
8
  export { makeLegacyWeakMap } from "./legacy/legacyWeakMap.js";
10
9
  export * from "./types.js";
11
10
  import type { MustMatch } from '@agoric/internal';
11
+ export { makeAtomicProvider, provideLazy } from "./stores/store-utils.js";
12
12
  export { isKey, assertKey, assertScalarKey, makeCopySet, getCopySetKeys, makeCopyBag, makeCopyBagFromElements, getCopyBagEntries, makeCopyMap, getCopyMapEntries, coerceToElements, coerceToBagEntries, compareKeys, keyLT, keyLTE, keyEQ, keyGTE, keyGT, elementsIsSuperset, elementsIsDisjoint, elementsCompare, elementsUnion, elementsDisjointUnion, elementsIntersection, elementsDisjointSubtract, setIsSuperset, setIsDisjoint, setCompare, setUnion, setDisjointUnion, setIntersection, setDisjointSubtract, bagIsSuperbag, bagCompare, bagUnion, bagIntersection, bagDisjointSubtract, M, getRankCover, isPattern, assertPattern, matches, isCopySet, isCopyMap } from "@endo/patterns";
13
13
  export { initEmpty, defineExoClass, defineExoClassKit, makeExo } from "@endo/exo";
14
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":";;;;;AAgEA,wBAAwB;AACxB,wBADW,SAAS,CACuB;;;;+BAhEf,kBAAkB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":";;;;AAgEA,wBAAwB;AACxB,wBADW,SAAS,CACuB;;;;+BAhEf,kBAAkB"}
package/src/index.js CHANGED
@@ -8,7 +8,7 @@ export { makeScalarSetStore } from './stores/scalarSetStore.js';
8
8
  export { makeScalarWeakMapStore } from './stores/scalarWeakMapStore.js';
9
9
  export { makeScalarMapStore } from './stores/scalarMapStore.js';
10
10
 
11
- export { provideLazy } from './stores/store-utils.js';
11
+ export { makeAtomicProvider, provideLazy } from './stores/store-utils.js';
12
12
 
13
13
  // /////////////////////// Deprecated Re-exports ///////////////////////////////
14
14
  // Importers should import directly from the packages shown below
@@ -1,5 +1,5 @@
1
1
  export function makeMapStoreMethods<K extends Key, V extends Passable>(jsmap: Map<K, V>, assertKVOkToAdd: (k: K, v: V) => void, assertKVOkToSet: (k: K, v: V) => void, assertKeyOkToDelete?: (k: K) => void, tag?: string): MapStoreMethods<K, V>;
2
- export function makeScalarMapStore(tag?: string, { keyShape, valueShape }?: StoreOptions): MapStore<any, any>;
2
+ export function makeScalarMapStore<K, V>(tag?: string, { keyShape, valueShape }?: StoreOptions): MapStore<K, V>;
3
3
  import type { Key } from '@endo/patterns';
4
4
  import type { Passable } from '@endo/pass-style';
5
5
  import type { MapStoreMethods } from '../types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"scalarMapStore.d.ts","sourceRoot":"","sources":["scalarMapStore.js"],"names":[],"mappings":"AAkCO,oCATY,CAAC,SAAP,GAAK,EACM,CAAC,SAAZ,QAAU,SACZ,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,mBACT,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,IAAI,mBACpB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,IAAI,wBACpB,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,QACd,MAAM,GACJ,gBAAgB,CAAC,EAAE,CAAC,CAAC,CAyFjC;AAiBM,yCAJI,MAAM,6BACN,YAAY,GACV,SAAS,GAAG,EAAE,GAAG,CAAC,CA8C9B;yBAlK8B,gBAAgB;8BADpB,kBAAkB;qCAEa,aAAa;kCAAb,aAAa;8BAAb,aAAa"}
1
+ {"version":3,"file":"scalarMapStore.d.ts","sourceRoot":"","sources":["scalarMapStore.js"],"names":[],"mappings":"AAkCO,oCATY,CAAC,SAAP,GAAK,EACM,CAAC,SAAZ,QAAU,SACZ,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,mBACT,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,IAAI,mBACpB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,IAAI,wBACpB,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,QACd,MAAM,GACJ,gBAAgB,CAAC,EAAE,CAAC,CAAC,CAyFjC;AAmBM,mCANM,CAAC,EACD,CAAC,QACH,MAAM,6BACN,YAAY,GACV,SAAS,CAAC,EAAE,CAAC,CAAC,CA8C1B;yBApK8B,gBAAgB;8BADpB,kBAAkB;qCAEa,aAAa;kCAAb,aAAa;8BAAb,aAAa"}
@@ -132,9 +132,11 @@ export const makeMapStoreMethods = (
132
132
  * or remotables. Other storeMaps will accept, for example, copyArrays and
133
133
  * copyRecords, as keys and look them up based on equality of their contents.
134
134
  *
135
+ * @template K=any
136
+ * @template V=any
135
137
  * @param {string} [tag] - the column name for the key
136
138
  * @param {StoreOptions} [options]
137
- * @returns {MapStore<any, any>}
139
+ * @returns {MapStore<K, V>}
138
140
  */
139
141
  export const makeScalarMapStore = (
140
142
  tag = 'key',
@@ -1,5 +1,3 @@
1
- export function isCopySet(s: unknown): s is CopySet;
2
- export function isCopyMap(m: unknown): m is CopyMap;
3
1
  export function makeCurrentKeysKit<K extends Key, V extends Passable>(getRawKeys: () => Iterable<K>, checkHas: (k: K) => boolean, compare: RankCompare, assertOkToAdd: (k: K, v?: V) => void, assertOkToDelete?: (k: K) => void, keyName?: string): CurrentKeysKit<K, V>;
4
2
  export function provideLazy<K extends Key, V extends Passable>(mapStore: WeakMapStore<K, V>, key: K, makeValue: (key: K) => V): V;
5
3
  export function makeAtomicProvider<K extends Key, V extends Passable>(store: WeakMapStore<K, V>): {
@@ -15,9 +13,12 @@ export type CurrentKeysKit<K extends Key, V extends Passable> = {
15
13
  * <K, V>
16
14
  */
17
15
  export type AtomicProvider<K extends Key, V extends Passable> = ReturnType<typeof makeAtomicProvider<K, V>>;
16
+ import { isCopyMap } from '@endo/patterns';
17
+ import { isCopySet } from '@endo/patterns';
18
18
  import type { Key } from '@endo/patterns';
19
19
  import type { Passable } from '@endo/pass-style';
20
20
  import type { RankCompare } from '@endo/marshal';
21
21
  import type { WeakMapStore } from '../types.js';
22
22
  import type { MapStore } from '../types.js';
23
+ export { isCopyMap, isCopySet };
23
24
  //# sourceMappingURL=store-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"store-utils.d.ts","sourceRoot":"","sources":["store-utils.js"],"names":[],"mappings":"AAqBO,6BAHI,OAAO,GACL,CAAC,IAAI,OAAO,CAEwB;AAY1C,6BAHI,OAAO,GACL,CAAC,IAAI,OAAO,CAEwB;AAsB1C,mCAVY,CAAC,SAAP,GAAK,EACM,CAAC,SAAZ,QAAU,cACZ,MAAM,QAAQ,CAAC,CAAC,CAAC,YACjB,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,WACjB,WAAW,iBACX,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,qBACrB,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,YACd,MAAM,GACJ,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CA4DhC;AAeM,4BAPY,CAAC,SAAP,GAAK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ACrB,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,YACd,MAAM,GACJ,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CA4DhC;AAeM,4BAPY,CAAC,SAAP,GAAK,EACM,CAAC,SAAZ,QAAU,YACZ,aAAa,CAAC,EAAE,CAAC,CAAC,OAClB,CAAC,aACD,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GACX,CAAC,CAOb;AAkBM,mCAJY,CAAC,SAAP,GAAK,EACM,CAAC,SAAZ,QAAU,SACZ,aAAa,CAAC,EAAE,CAAC,CAAC;wBAYhB,CAAC,aACD,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,gBAEtB,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,KAEjC,OAAO,CAAC,CAAC,CAAC;EA6BxB;AAeM,oCANY,CAAC,SAAP,GAAK,EACM,CAAC,SAAZ,QAAU,YACZ,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,OAChB,CAAC,QACD,CAAC,QASX;2BArLkB,CAAC,SAAP,GAAK,EACM,CAAC,SAAZ,QAAU;uBAET,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI;0BACrB,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI;kBACd,QAAQ,CAAC,CAAC,CAAC;;;;;2BA6JN,CAAC,SAAP,GAAK,EACM,CAAC,SAAZ,QAAU,IACV,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;0BAhLnB,gBAAgB;0BAAhB,gBAAgB;yBAM/B,gBAAgB;8BADX,kBAAkB;iCAFf,eAAe;kCACJ,aAAa;8BAAb,aAAa"}
@@ -1,6 +1,6 @@
1
1
  import { Fail, q } from '@endo/errors';
2
2
  import { Far } from '@endo/marshal';
3
- import { M, matches } from '@endo/patterns';
3
+ import { isCopyMap, isCopySet } from '@endo/patterns';
4
4
 
5
5
  /**
6
6
  * @import {RankCompare} from '@endo/marshal';
@@ -9,29 +9,7 @@ import { M, matches } from '@endo/patterns';
9
9
  * @import {Key} from '@endo/patterns';
10
10
  */
11
11
 
12
- // TODO: Undate `@endo/patterns` to export the original, and delete the
13
- // reimplementation here.
14
- /**
15
- * Should behave identically to the one in `@endo/patterns`, but reimplemented
16
- * for now because `@endo/patterns` forgot to export this one. This one is
17
- * simple enough that I prefer a reimplementation to a deep import.
18
- *
19
- * @param {unknown} s
20
- * @returns {s is CopySet}
21
- */
22
- export const isCopySet = s => matches(s, M.set());
23
-
24
- // TODO: Undate `@endo/patterns` to export the original, and delete the
25
- // reimplementation here.
26
- /**
27
- * Should behave identically to the one in `@endo/patterns`, but reimplemented
28
- * for now because `@endo/patterns` forgot to export this one. This one is
29
- * simple enough that I prefer a reimplementation to a deep import.
30
- *
31
- * @param {unknown} m
32
- * @returns {m is CopyMap}
33
- */
34
- export const isCopyMap = m => matches(m, M.map());
12
+ export { isCopyMap, isCopySet };
35
13
 
36
14
  /**
37
15
  * @template {Key} K