You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

interface-store

Package Overview
Dependencies
Maintainers
2
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

interface-store - npm Package Compare versions

Comparing version
6.0.2
to
6.0.3
+7
dist/index.min.js.map
{
"version": 3,
"sources": ["../src/index.ts", "../src/errors.ts"],
"sourcesContent": ["/**\n * @packageDocumentation\n *\n * An abstraction of the Datastore/Blockstore codebases.\n */\n\n/**\n * An iterable or async iterable of values\n */\nexport type AwaitIterable<T> = Iterable<T> | AsyncIterable<T>\n\n/**\n * A value or a promise of a value\n */\nexport type Await<T> = Promise<T> | T\n\n/**\n * Options for async operations.\n */\nexport interface AbortOptions {\n signal?: AbortSignal\n}\n\nexport interface Store<Key, Value, Pair, HasOptionsExtension = {},\n PutOptionsExtension = {}, PutManyOptionsExtension = {},\n GetOptionsExtension = {}, GetManyOptionsExtension = {},\n DeleteOptionsExtension = {}, DeleteManyOptionsExtension = {}> {\n /**\n * Check for the existence of a value for the passed key\n *\n * @example\n * ```js\n *const exists = await store.has(new Key('awesome'))\n *\n *if (exists) {\n * console.log('it is there')\n *} else {\n * console.log('it is not there')\n *}\n *```\n */\n has(key: Key, options?: AbortOptions & HasOptionsExtension): Await<boolean>\n\n /**\n * Store the passed value under the passed key\n *\n * @example\n *\n * ```js\n * await store.put([{ key: new Key('awesome'), value: new Uint8Array([0, 1, 2, 3]) }])\n * ```\n */\n put(key: Key, val: Value, options?: AbortOptions & PutOptionsExtension): Await<Key>\n\n /**\n * Store the given key/value pairs\n *\n * @example\n * ```js\n * const source = [{ key: new Key('awesome'), value: new Uint8Array([0, 1, 2, 3]) }]\n *\n * for await (const { key, value } of store.putMany(source)) {\n * console.info(`put content for key ${key}`)\n * }\n * ```\n */\n putMany(\n source: AwaitIterable<Pair>,\n options?: AbortOptions & PutManyOptionsExtension\n ): AwaitIterable<Key>\n\n /**\n * Retrieve the value stored under the given key\n *\n * @example\n * ```js\n * const value = await store.get(new Key('awesome'))\n * console.log('got content: %s', value.toString('utf8'))\n * // => got content: datastore\n * ```\n */\n get(key: Key, options?: AbortOptions & GetOptionsExtension): Await<Value>\n\n /**\n * Retrieve values for the passed keys\n *\n * @example\n * ```js\n * for await (const { key, value } of store.getMany([new Key('awesome')])) {\n * console.log(`got \"${key}\" = \"${new TextDecoder('utf8').decode(value)}\"`')\n * // => got \"/awesome\" = \"datastore\"\n * }\n * ```\n */\n getMany(\n source: AwaitIterable<Key>,\n options?: AbortOptions & GetManyOptionsExtension\n ): AwaitIterable<Pair>\n\n /**\n * Remove the record for the passed key\n *\n * @example\n *\n * ```js\n * await store.delete(new Key('awesome'))\n * console.log('deleted awesome content :(')\n * ```\n */\n delete(key: Key, options?: AbortOptions & DeleteOptionsExtension): Await<void>\n\n /**\n * Remove values for the passed keys\n *\n * @example\n *\n * ```js\n * const source = [new Key('awesome')]\n *\n * for await (const key of store.deleteMany(source)) {\n * console.log(`deleted content with key ${key}`)\n * }\n * ```\n */\n deleteMany(\n source: AwaitIterable<Key>,\n options?: AbortOptions & DeleteManyOptionsExtension\n ): AwaitIterable<Key>\n}\n\nexport * from './errors.js'\n", "export class OpenFailedError extends Error {\n static name = 'OpenFailedError'\n static code = 'ERR_OPEN_FAILED'\n name = OpenFailedError.name\n code = OpenFailedError.code\n\n constructor (message = 'Open failed') {\n super(message)\n }\n}\n\nexport class CloseFailedError extends Error {\n static name = 'CloseFailedError'\n static code = 'ERR_CLOSE_FAILED'\n name = CloseFailedError.name\n code = CloseFailedError.code\n\n constructor (message = 'Close failed') {\n super(message)\n }\n}\n\nexport class PutFailedError extends Error {\n static name = 'PutFailedError'\n static code = 'ERR_PUT_FAILED'\n name = PutFailedError.name\n code = PutFailedError.code\n\n constructor (message = 'Put failed') {\n super(message)\n }\n}\n\nexport class GetFailedError extends Error {\n static name = 'GetFailedError'\n static code = 'ERR_GET_FAILED'\n name = GetFailedError.name\n code = GetFailedError.code\n\n constructor (message = 'Get failed') {\n super(message)\n }\n}\n\nexport class DeleteFailedError extends Error {\n static name = 'DeleteFailedError'\n static code = 'ERR_DELETE_FAILED'\n name = DeleteFailedError.name\n code = DeleteFailedError.code\n\n constructor (message = 'Delete failed') {\n super(message)\n }\n}\n\nexport class HasFailedError extends Error {\n static name = 'HasFailedError'\n static code = 'ERR_HAS_FAILED'\n name = HasFailedError.name\n code = HasFailedError.code\n\n constructor (message = 'Has failed') {\n super(message)\n }\n}\n\nexport class NotFoundError extends Error {\n static name = 'NotFoundError'\n static code = 'ERR_NOT_FOUND'\n name = NotFoundError.name\n code = NotFoundError.code\n\n constructor (message = 'Not Found') {\n super(message)\n }\n}\n\nexport class AbortError extends Error {\n static name = 'AbortError'\n static code = 'ERR_ABORTED'\n name = AbortError.name\n code = AbortError.code\n\n constructor (message = 'Aborted') {\n super(message)\n }\n}\n"],
"mappings": ";kcAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,EAAA,qBAAAC,EAAA,sBAAAC,EAAA,mBAAAC,EAAA,mBAAAC,EAAA,kBAAAC,EAAA,oBAAAC,EAAA,mBAAAC,ICAM,IAAOC,EAAP,MAAOC,UAAwB,KAAK,CACxC,OAAO,KAAO,kBACd,OAAO,KAAO,kBACd,KAAOA,EAAgB,KACvB,KAAOA,EAAgB,KAEvB,YAAaC,EAAU,cAAa,CAClC,MAAMA,CAAO,CACf,GAGWC,EAAP,MAAOC,UAAyB,KAAK,CACzC,OAAO,KAAO,mBACd,OAAO,KAAO,mBACd,KAAOA,EAAiB,KACxB,KAAOA,EAAiB,KAExB,YAAaF,EAAU,eAAc,CACnC,MAAMA,CAAO,CACf,GAGWG,EAAP,MAAOC,UAAuB,KAAK,CACvC,OAAO,KAAO,iBACd,OAAO,KAAO,iBACd,KAAOA,EAAe,KACtB,KAAOA,EAAe,KAEtB,YAAaJ,EAAU,aAAY,CACjC,MAAMA,CAAO,CACf,GAGWK,EAAP,MAAOC,UAAuB,KAAK,CACvC,OAAO,KAAO,iBACd,OAAO,KAAO,iBACd,KAAOA,EAAe,KACtB,KAAOA,EAAe,KAEtB,YAAaN,EAAU,aAAY,CACjC,MAAMA,CAAO,CACf,GAGWO,EAAP,MAAOC,UAA0B,KAAK,CAC1C,OAAO,KAAO,oBACd,OAAO,KAAO,oBACd,KAAOA,EAAkB,KACzB,KAAOA,EAAkB,KAEzB,YAAaR,EAAU,gBAAe,CACpC,MAAMA,CAAO,CACf,GAGWS,EAAP,MAAOC,UAAuB,KAAK,CACvC,OAAO,KAAO,iBACd,OAAO,KAAO,iBACd,KAAOA,EAAe,KACtB,KAAOA,EAAe,KAEtB,YAAaV,EAAU,aAAY,CACjC,MAAMA,CAAO,CACf,GAGWW,EAAP,MAAOC,UAAsB,KAAK,CACtC,OAAO,KAAO,gBACd,OAAO,KAAO,gBACd,KAAOA,EAAc,KACrB,KAAOA,EAAc,KAErB,YAAaZ,EAAU,YAAW,CAChC,MAAMA,CAAO,CACf,GAGWa,EAAP,MAAOC,UAAmB,KAAK,CACnC,OAAO,KAAO,aACd,OAAO,KAAO,cACd,KAAOA,EAAW,KAClB,KAAOA,EAAW,KAElB,YAAad,EAAU,UAAS,CAC9B,MAAMA,CAAO,CACf",
"names": ["index_exports", "__export", "AbortError", "CloseFailedError", "DeleteFailedError", "GetFailedError", "HasFailedError", "NotFoundError", "OpenFailedError", "PutFailedError", "OpenFailedError", "_OpenFailedError", "message", "CloseFailedError", "_CloseFailedError", "PutFailedError", "_PutFailedError", "GetFailedError", "_GetFailedError", "DeleteFailedError", "_DeleteFailedError", "HasFailedError", "_HasFailedError", "NotFoundError", "_NotFoundError", "AbortError", "_AbortError"]
}
+1
-0
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.InterfaceStore = factory()}(typeof self !== 'undefined' ? self : this, function () {
"use strict";var InterfaceStore=(()=>{var r=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var D=(e,t)=>{for(var o in t)r(e,o,{get:t[o],enumerable:!0})},A=(e,t,o,u)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of R(t))!l.call(e,c)&&c!==o&&r(e,c,{get:()=>t[c],enumerable:!(u=x(t,c))||u.enumerable});return e};var F=e=>A(r({},"__esModule",{value:!0}),e);var L={};D(L,{AbortError:()=>p,CloseFailedError:()=>a,DeleteFailedError:()=>E,GetFailedError:()=>d,HasFailedError:()=>m,NotFoundError:()=>i,OpenFailedError:()=>s,PutFailedError:()=>n});var s=class e extends Error{static name="OpenFailedError";static code="ERR_OPEN_FAILED";name=e.name;code=e.code;constructor(t="Open failed"){super(t)}},a=class e extends Error{static name="CloseFailedError";static code="ERR_CLOSE_FAILED";name=e.name;code=e.code;constructor(t="Close failed"){super(t)}},n=class e extends Error{static name="PutFailedError";static code="ERR_PUT_FAILED";name=e.name;code=e.code;constructor(t="Put failed"){super(t)}},d=class e extends Error{static name="GetFailedError";static code="ERR_GET_FAILED";name=e.name;code=e.code;constructor(t="Get failed"){super(t)}},E=class e extends Error{static name="DeleteFailedError";static code="ERR_DELETE_FAILED";name=e.name;code=e.code;constructor(t="Delete failed"){super(t)}},m=class e extends Error{static name="HasFailedError";static code="ERR_HAS_FAILED";name=e.name;code=e.code;constructor(t="Has failed"){super(t)}},i=class e extends Error{static name="NotFoundError";static code="ERR_NOT_FOUND";name=e.name;code=e.code;constructor(t="Not Found"){super(t)}},p=class e extends Error{static name="AbortError";static code="ERR_ABORTED";name=e.name;code=e.code;constructor(t="Aborted"){super(t)}};return F(L);})();
return InterfaceStore}));
//# sourceMappingURL=index.min.js.map
+1
-1

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

{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC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WG;IACH,OAAO,CACL,MAAM,EAAE,aAAa,CAAC,IAAI,CAAC,EAC3B,OAAO,CAAC,EAAE,YAAY,GAAG,uBAAuB,GAC/C,aAAa,CAAC,GAAG,CAAC,CAAA;IAErB;;;;;;;;;OASG;IACH,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,mBAAmB,GAAG,KAAK,CAAC,KAAK,CAAC,CAAA;IAEzE;;;;;;;;;;OAUG;IACH,OAAO,CACL,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,EAC1B,OAAO,CAAC,EAAE,YAAY,GAAG,uBAAuB,GAC/C,aAAa,CAAC,IAAI,CAAC,CAAA;IAEtB;;;;;;;;;OASG;IACH,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,sBAAsB,GAAG,KAAK,CAAC,IAAI,CAAC,CAAA;IAE9E;;;;;;;;;;;;OAYG;IACH,UAAU,CACR,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,EAC1B,OAAO,CAAC,EAAE,YAAY,GAAG,0BAA0B,GAClD,aAAa,CAAC,GAAG,CAAC,CAAA;CACtB;AAED,cAAc,aAAa,CAAA"}

@@ -1,7 +0,7 @@

/* eslint-disable @typescript-eslint/ban-types */
// this ignore is so we can use {} as the default value for the options
// extensions below - it normally means "any non-nullish value" but here
// we are using it as an intersection type - see the aside at the bottom:
// https://github.com/typescript-eslint/typescript-eslint/issues/2063#issuecomment-675156492
/**
* @packageDocumentation
*
* An abstraction of the Datastore/Blockstore codebases.
*/
export * from './errors.js';
//# sourceMappingURL=index.js.map

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

{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,uEAAuE;AACvE,wEAAwE;AACxE,yEAAyE;AACzE,4FAA4F;AAoI5F,cAAc,aAAa,CAAA"}
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA8HH,cAAc,aAAa,CAAA"}
{
"AbortError": "https://ipfs.github.io/js-stores/classes/interface_store.AbortError.html",
"CloseFailedError": "https://ipfs.github.io/js-stores/classes/interface_store.CloseFailedError.html",
"DeleteFailedError": "https://ipfs.github.io/js-stores/classes/interface_store.DeleteFailedError.html",
"GetFailedError": "https://ipfs.github.io/js-stores/classes/interface_store.GetFailedError.html",
"HasFailedError": "https://ipfs.github.io/js-stores/classes/interface_store.HasFailedError.html",
"NotFoundError": "https://ipfs.github.io/js-stores/classes/interface_store.NotFoundError.html",
"OpenFailedError": "https://ipfs.github.io/js-stores/classes/interface_store.OpenFailedError.html",
"PutFailedError": "https://ipfs.github.io/js-stores/classes/interface_store.PutFailedError.html",
"AbortOptions": "https://ipfs.github.io/js-stores/interfaces/interface_store.AbortOptions.html",
".:AbortOptions": "https://ipfs.github.io/js-stores/interfaces/interface_store.AbortOptions.html",
"Store": "https://ipfs.github.io/js-stores/interfaces/interface_store.Store.html",
".:Store": "https://ipfs.github.io/js-stores/interfaces/interface_store.Store.html",
"Await": "https://ipfs.github.io/js-stores/types/interface_store.Await.html",
".:Await": "https://ipfs.github.io/js-stores/types/interface_store.Await.html",
"AwaitIterable": "https://ipfs.github.io/js-stores/types/interface_store.AwaitIterable.html",
".:AwaitIterable": "https://ipfs.github.io/js-stores/types/interface_store.AwaitIterable.html"
"AbortError": "https://ipfs.github.io/js-stores/classes/interface-store.AbortError.html",
"CloseFailedError": "https://ipfs.github.io/js-stores/classes/interface-store.CloseFailedError.html",
"DeleteFailedError": "https://ipfs.github.io/js-stores/classes/interface-store.DeleteFailedError.html",
"GetFailedError": "https://ipfs.github.io/js-stores/classes/interface-store.GetFailedError.html",
"HasFailedError": "https://ipfs.github.io/js-stores/classes/interface-store.HasFailedError.html",
"NotFoundError": "https://ipfs.github.io/js-stores/classes/interface-store.NotFoundError.html",
"OpenFailedError": "https://ipfs.github.io/js-stores/classes/interface-store.OpenFailedError.html",
"PutFailedError": "https://ipfs.github.io/js-stores/classes/interface-store.PutFailedError.html",
"AbortOptions": "https://ipfs.github.io/js-stores/interfaces/interface-store.AbortOptions.html",
".:AbortOptions": "https://ipfs.github.io/js-stores/interfaces/interface-store.AbortOptions.html",
"Store": "https://ipfs.github.io/js-stores/interfaces/interface-store.Store.html",
".:Store": "https://ipfs.github.io/js-stores/interfaces/interface-store.Store.html",
"Await": "https://ipfs.github.io/js-stores/types/interface-store.Await.html",
".:Await": "https://ipfs.github.io/js-stores/types/interface-store.Await.html",
"AwaitIterable": "https://ipfs.github.io/js-stores/types/interface-store.AwaitIterable.html",
".:AwaitIterable": "https://ipfs.github.io/js-stores/types/interface-store.AwaitIterable.html"
}
{
"name": "interface-store",
"version": "6.0.2",
"version": "6.0.3",
"description": "A generic interface for storing and retrieving data",

@@ -32,9 +32,2 @@ "license": "Apache-2.0 OR MIT",

},
"eslintConfig": {
"extends": "ipfs",
"parserOptions": {
"project": true,
"sourceType": "module"
}
},
"release": {

@@ -122,3 +115,11 @@ "branches": [

"@semantic-release/github",
"@semantic-release/git"
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md",
"package.json"
]
}
]
]

@@ -134,4 +135,4 @@ },

"devDependencies": {
"aegir": "^44.1.1"
"aegir": "^47.0.16"
}
}

@@ -1,7 +0,1 @@

/* eslint-disable @typescript-eslint/ban-types */
// this ignore is so we can use {} as the default value for the options
// extensions below - it normally means "any non-nullish value" but here
// we are using it as an intersection type - see the aside at the bottom:
// https://github.com/typescript-eslint/typescript-eslint/issues/2063#issuecomment-675156492
/**

@@ -8,0 +2,0 @@ * @packageDocumentation

This project is dual licensed under MIT and Apache-2.0.
MIT: https://www.opensource.org/licenses/mit
Apache-2.0: https://www.apache.org/licenses/license-2.0