New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@agoric/store

Package Overview
Dependencies
Maintainers
0
Versions
2760
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agoric/store - npm Package Compare versions

Comparing version 0.9.3-dev-21fe8d9.0 to 0.9.3-dev-221a4b4.0

src/index.d.ts

25

package.json
{
"name": "@agoric/store",
"version": "0.9.3-dev-21fe8d9.0+21fe8d9",
"version": "0.9.3-dev-221a4b4.0+221a4b4",
"description": "Wrapper for JavaScript map",

@@ -17,3 +17,5 @@ "type": "module",

"lint:types": "tsc",
"lint:eslint": "eslint ."
"lint:eslint": "eslint .",
"prepack": "tsc --build tsconfig.build.json",
"postpack": "git clean -f '*.d.ts*' '*.tsbuildinfo'"
},

@@ -34,10 +36,11 @@ "repository": {

"dependencies": {
"@endo/exo": "^1.3.0",
"@endo/marshal": "^1.4.0",
"@endo/pass-style": "^1.3.0",
"@endo/patterns": "^1.3.0"
"@endo/errors": "^1.2.9",
"@endo/exo": "^1.5.8",
"@endo/marshal": "^1.6.3",
"@endo/pass-style": "^1.4.8",
"@endo/patterns": "^1.4.8"
},
"devDependencies": {
"@endo/init": "^1.1.0",
"@endo/ses-ava": "^1.2.0",
"@endo/init": "^1.1.8",
"@endo/ses-ava": "^1.2.9",
"ava": "^5.3.0"

@@ -55,3 +58,3 @@ },

"files": [
"test/**/test-*.js"
"test/**/*.test.*"
],

@@ -64,5 +67,5 @@ "require": [

"typeCoverage": {
"atLeast": 86.12
"atLeast": 89.69
},
"gitHead": "21fe8d921225214fb388191548ad63d81912e65f"
"gitHead": "221a4b4cbb5e8e14db1260d19209fdc478836b1f"
}

@@ -0,1 +1,6 @@

/**
* @import {MustMatch} from '@agoric/internal';
*/
import { mustMatch as typelessMustMatch } from '@endo/patterns';
export { makeScalarWeakSetStore } from './stores/scalarWeakSetStore.js';

@@ -54,3 +59,2 @@ export { makeScalarSetStore } from './stores/scalarSetStore.js';

matches,
mustMatch,
isCopySet,

@@ -60,2 +64,7 @@ isCopyMap,

// XXX @agoric/store should not depend on @agoric/internal
// TODO move to Endo
/** @type {MustMatch} */
export const mustMatch = typelessMustMatch;
export {

@@ -72,1 +81,3 @@ initEmpty,

export { makeLegacyWeakMap } from './legacy/legacyWeakMap.js';
// eslint-disable-next-line import/export
export * from './types.js';

@@ -1,5 +0,5 @@

import '../types.js';
/** @import {LegacyMap, LegacyWeakMap} from '../types.js'; */
// TODO, once migrated to endo, import from @endo/errors instead
const { Fail, quote: q } = assert;
import { Fail, q } from '@endo/errors';

@@ -6,0 +6,0 @@ /**

@@ -1,5 +0,5 @@

import '../types.js';
/** @import {LegacyWeakMap} from '../types.js'; */
// TODO, once migrated to endo, import from @endo/errors instead
const { Fail, quote: q } = assert;
import { Fail, q } from '@endo/errors';

@@ -6,0 +6,0 @@ /**

@@ -0,1 +1,2 @@

import { q } from '@endo/errors';
import {

@@ -18,7 +19,6 @@ Far,

const { quote: q } = assert;
/**
* @import {Passable} from '@endo/pass-style')
* @import {Key} from '@endo/patterns')
* @import {Passable} from '@endo/pass-style';
* @import {Key, Pattern} from '@endo/patterns';
* @import {MapStore, MapStoreMethods, StoreOptions} from '../types.js';
*/

@@ -34,3 +34,3 @@

* @param {string} [tag]
* @returns {MapStore<K, V>}
* @returns {MapStoreMethods<K, V>}
*/

@@ -137,7 +137,5 @@ export const makeMapStoreMethods = (

*
* @template {Key} K
* @template {Passable} V
* @param {string} [tag] - the column name for the key
* @param {StoreOptions} [options]
* @returns {MapStore<K, V>}
* @returns {MapStore<any, any>}
*/

@@ -144,0 +142,0 @@ export const makeScalarMapStore = (

@@ -0,1 +1,2 @@

import { q } from '@endo/errors';
import { Far, filterIterable } from '@endo/pass-style';

@@ -13,6 +14,9 @@ import { compareRank } from '@endo/marshal';

const { quote: q } = assert;
/**
* @import {Key, Pattern} from '@endo/patterns';
* @import {SetStore, SetStoreMethods, StoreOptions} from '../types.js';
*/
/**
* @template K
* @template {Key} K
* @param {Set<K>} jsset

@@ -22,3 +26,3 @@ * @param {(k: K) => void} assertKeyOkToAdd

* @param {string} [keyName]
* @returns {SetStore<K>}
* @returns {SetStoreMethods<K>}
*/

@@ -25,0 +29,0 @@ export const makeSetStoreMethods = (

@@ -0,1 +1,2 @@

import { q, Fail } from '@endo/errors';
import { Far, assertPassable, passStyleOf } from '@endo/pass-style';

@@ -9,6 +10,11 @@ import {

const { quote: q, Fail } = assert;
/**
* @import {Key} from '@endo/patterns';
* @import {Passable, RemotableObject} from '@endo/pass-style';
* @import {WeakMapStore, StoreOptions} from '../types.js';
*/
/**
* @template K,V
* @template {Key} K
* @template {Passable} V
* @param {WeakMap<K & object, V>} jsmap

@@ -68,2 +74,3 @@ * @param {(k: K, v: V) => void} assertKVOkToAdd

if (Object.isFrozen(entries) && isCopyMap(entries)) {
// @ts-expect-error XXX
entries = getCopyMapEntries(entries);

@@ -99,3 +106,3 @@ } else {

* @param {StoreOptions} [options]
* @returns {WeakMapStore<K, V>}
* @returns {RemotableObject & WeakMapStore<K, V>}
*/

@@ -102,0 +109,0 @@ export const makeScalarWeakMapStore = (

@@ -0,1 +1,2 @@

import { q, Fail } from '@endo/errors';
import { Far, passStyleOf } from '@endo/pass-style';

@@ -9,8 +10,9 @@ import {

const { quote: q, Fail } = assert;
/**
* @import {Key} from '@endo/patterns';
* @import {StoreOptions, WeakSetStore, WeakSetStoreMethods} from '@agoric/store';
*/
/** @import {WeakSetStore} from '@agoric/store/exported.js'; */
/**
* @template K
* @template {Key} K
* @param {WeakSet<K & object>} jsset

@@ -20,3 +22,3 @@ * @param {(k: K) => void} assertKeyOkToAdd

* @param {string} [keyName]
* @returns {WeakSetStore<K>}
* @returns {WeakSetStoreMethods<K>}
*/

@@ -55,2 +57,3 @@ export const makeWeakSetStoreMethods = (

if (Object.isFrozen(keys) && isCopySet(keys)) {
// @ts-expect-error XXX
keys = getCopySetKeys(keys);

@@ -57,0 +60,0 @@ } else {

@@ -0,9 +1,17 @@

import { Fail, q } from '@endo/errors';
import { Far } from '@endo/marshal';
import { isCopyMap, isCopySet } from '@endo/patterns';
/** @import {RankCompare} from '@endo/marshal' */
/**
* @import {RankCompare} from '@endo/marshal';
* @import {MapStore, WeakMapStore} from '../types.js';
* @import {Passable} from '@endo/pass-style';
* @import {Key} from '@endo/patterns';
*/
const { Fail, quote: q } = assert;
export { isCopyMap, isCopySet };
/**
* @template K,V
* @template {Key} K
* @template {Passable} V
* @typedef {object} CurrentKeysKit

@@ -16,3 +24,4 @@ * @property {(k: K, v?: V) => void} assertUpdateOnAdd

/**
* @template K,V
* @template {Key} K
* @template {Passable} V
* @param {() => Iterable<K>} getRawKeys

@@ -92,3 +101,4 @@ * @param {(k: K) => boolean} checkHas

*
* @template K,V
* @template {Key} K
* @template {Passable} V
* @param {WeakMapStore<K, V>} mapStore

@@ -118,4 +128,4 @@ * @param {K} key

*
* @template K
* @template V
* @template {Key} K
* @template {Passable} V
* @param {WeakMapStore<K, V>} store

@@ -170,4 +180,4 @@ */

/**
* @template K
* @template V
* @template {Key} K
* @template {Passable} V
* @typedef {ReturnType<typeof makeAtomicProvider<K, V>>} AtomicProvider<K, V>

@@ -177,3 +187,4 @@ */

/**
* @template K, V
* @template {Key} K
* @template {Passable} V
* @param {MapStore<K, V[]>} mapStore

@@ -180,0 +191,0 @@ * @param {K} key

@@ -1,2 +0,2 @@

/// <reference types="ses"/>
/// <reference types="ses" />

@@ -9,3 +9,3 @@ // Ensure this is a module.

*
* @import {Passable} from '@endo/pass-style'
* @import {Passable, RemotableObject} from '@endo/pass-style'
* @import {CopySet, CopyMap, Pattern} from '@endo/patterns'

@@ -53,5 +53,6 @@ * @import {Key} from '@endo/patterns'

// TODO use Key for K
/**
* @template {Key & object} [K=Key]
* @typedef {object} WeakSetStore
* @template K
* @typedef {object} WeakSetStoreMethods
* @property {(key: K) => boolean} has Check if a key exists. The key can be any

@@ -65,8 +66,13 @@ * JavaScript value, though the answer will always be false for keys that

* @property {(key: K) => void} delete Remove the key. Throws if not found.
* @property {(keys: CopySet<K> | Iterable<K>) => void} addAll
* @property {(keys: CopySet<any> | Iterable<K>) => void} addAll
*/
/**
* @template K
* @typedef {RemotableObject & WeakSetStoreMethods<K>} WeakSetStore
*/
// TODO use Key for K
/**
* @template {Key} [K=Key]
* @typedef {object} SetStore
* @template K
* @typedef {object} SetStoreMethods
* @property {(key: K) => boolean} has Check if a key exists. The key can be any

@@ -80,13 +86,19 @@ * JavaScript value, though the answer will always be false for keys that

* @property {(key: K) => void} delete Remove the key. Throws if not found.
* @property {(keys: CopySet<K> | Iterable<K>) => void} addAll
* @property {(keys: CopySet<any> | Iterable<K>) => void} addAll
* @property {(keyPatt?: Pattern) => Iterable<K>} keys
* @property {(keyPatt?: Pattern) => Iterable<K>} values
* @property {(keyPatt?: Pattern) => CopySet<K>} snapshot
* @property {(keyPatt?: Pattern) => CopySet<any>} snapshot
* @property {(keyPatt?: Pattern) => number} getSize
* @property {(keyPatt?: Pattern) => void} clear
*/
/**
* @template K
* @typedef {RemotableObject & SetStoreMethods<K>} SetStore
*/
// TODO use Key for K
// TODO use Passable for V
/**
* @template {Key & object} [K=Key]
* @template {Passable} [V=Passable]
* @template K
* @template V
* @typedef {object} WeakMapStore

@@ -103,9 +115,11 @@ * @property {(key: K) => boolean} has Check if a key exists. The key can be any

* @property {(key: K) => void} delete Remove the key. Throws if not found.
* @property {(entries: CopyMap<K, V> | Iterable<[K, V]>) => void} addAll
* @property {(entries: CopyMap<any, any> | Iterable<[K, V]>) => void} addAll
*/
// TODO use Key for K
// TODO use Passable for V
/**
* @template {Key} [K=Key]
* @template {Passable} [V=Passable]
* @typedef {object} MapStore
* @template K
* @template V
* @typedef {object} MapStoreMethods
* @property {(key: K) => boolean} has Check if a key exists. The key can be any

@@ -121,10 +135,18 @@ * JavaScript value, though the answer will always be false for keys that

* @property {(key: K) => void} delete Remove the key. Throws if not found.
* @property {(entries: CopyMap<K, V> | Iterable<[K, V]>) => void} addAll
* @property {(entries: CopyMap<any, Passable> | Iterable<[K, V]>) => void} addAll
* @property {(keyPatt?: Pattern, valuePatt?: Pattern) => Iterable<K>} keys
* @property {(keyPatt?: Pattern, valuePatt?: Pattern) => Iterable<V>} values
* @property {(keyPatt?: Pattern, valuePatt?: Pattern) => Iterable<[K, V]>} entries
* @property {(keyPatt?: Pattern, valuePatt?: Pattern) => CopyMap<K, V>} snapshot
* @property {(
* keyPatt?: Pattern,
* valuePatt?: Pattern,
* ) => CopyMap<any, Passable>} snapshot
* @property {(keyPatt?: Pattern, valuePatt?: Pattern) => number} getSize
* @property {(keyPatt?: Pattern, valuePatt?: Pattern) => void} clear
*/
/**
* @template [K=any]
* @template [V=any]
* @typedef {RemotableObject & MapStoreMethods<K, V>} MapStore
*/

@@ -131,0 +153,0 @@ // ///////////////////////// Deprecated Legacy /////////////////////////////////

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc