Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

datastore-level

Package Overview
Dependencies
Maintainers
4
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datastore-level - npm Package Compare versions

Comparing version 9.0.4 to 10.0.0

dist/src/index.js

77

dist/src/index.d.ts

@@ -0,75 +1,26 @@

import { Batch, Key, KeyQuery, Pair, Query } from 'interface-datastore';
import { BaseDatastore } from 'datastore-core';
import { Level } from 'level';
import type { DatabaseOptions, OpenOptions } from 'level';
/**
* @typedef {import('interface-datastore').Datastore} Datastore
* @typedef {import('interface-datastore').Pair} Pair
* @typedef {import('interface-datastore').Batch} Batch
* @typedef {import('interface-datastore').Query} Query
* @typedef {import('interface-datastore').KeyQuery} KeyQuery
* @typedef {import('interface-datastore').Options} QueryOptions
* @typedef {import('abstract-level').AbstractLevel<any, string, Uint8Array>} LevelDb
*/
/**
* A datastore backed by leveldb
*/
export class LevelDatastore extends BaseDatastore {
/**
* @param {string | LevelDb} path
* @param {import('level').DatabaseOptions<string, Uint8Array> & import('level').OpenOptions} [opts]
*/
constructor(path: string | import("abstract-level/types/abstract-level").AbstractLevel<any, string, Uint8Array>, opts?: (import("classic-level").DatabaseOptions<string, Uint8Array> & import("browser-level").DatabaseOptions<string, Uint8Array> & import("classic-level").OpenOptions & import("abstract-level").AbstractOpenOptions) | undefined);
/** @type {LevelDb} */
db: import("abstract-level/types/abstract-level").AbstractLevel<any, string, Uint8Array>;
/** @type {import('level').OpenOptions} */
opts: import('level').OpenOptions;
/**
* @param {Key} key
* @param {Uint8Array} value
*/
export declare class LevelDatastore extends BaseDatastore {
db: Level<string, Uint8Array>;
private readonly opts;
constructor(path: string | Level<string, Uint8Array>, opts?: DatabaseOptions<string, Uint8Array> & OpenOptions);
open(): Promise<void>;
put(key: Key, value: Uint8Array): Promise<void>;
/**
* @param {Key} key
* @returns {Promise<Uint8Array>}
*/
get(key: Key): Promise<Uint8Array>;
/**
* @param {Key} key
* @returns {Promise<boolean>}
*/
has(key: Key): Promise<boolean>;
/**
* @param {Key} key
* @returns {Promise<void>}
*/
delete(key: Key): Promise<void>;
/**
* @param {Query} q
*/
query(q: Query): AsyncIterable<import("interface-datastore").Pair>;
/**
* @param {KeyQuery} q
*/
queryKeys(q: KeyQuery): AsyncGenerator<Key, void, undefined>;
/**
* @param {object} opts
* @param {boolean} opts.values
* @param {string} [opts.prefix]
* @returns {AsyncIterable<Pair>}
*/
close(): Promise<void>;
batch(): Batch;
query(q: Query): AsyncIterable<Pair>;
queryKeys(q: KeyQuery): AsyncIterable<Key>;
_query(opts: {
values: boolean;
prefix?: string | undefined;
prefix?: string;
}): AsyncIterable<Pair>;
}
export type LevelIterator = {
next: (cb: (err: Error, key: string | Uint8Array | null, value: any) => void) => void;
end: (cb: (err: Error) => void) => void;
};
export type Datastore = import('interface-datastore').Datastore;
export type Pair = import('interface-datastore').Pair;
export type Batch = import('interface-datastore').Batch;
export type Query = import('interface-datastore').Query;
export type KeyQuery = import('interface-datastore').KeyQuery;
export type QueryOptions = import('interface-datastore').Options;
export type LevelDb = import('abstract-level').AbstractLevel<any, string, Uint8Array>;
import { BaseDatastore } from "datastore-core";
import { Key } from "interface-datastore";
//# sourceMappingURL=index.d.ts.map
{
"name": "datastore-level",
"version": "9.0.4",
"version": "10.0.0",
"description": "Datastore implementation with level(up|down) backend",

@@ -55,3 +55,3 @@ "author": "Friedel Ziegelmayer<dignifiedquire@gmail.com>",

"types": "./dist/src/index.d.ts",
"import": "./src/index.js"
"import": "./dist/src/index.js"
}

@@ -165,5 +165,4 @@ },

"dependencies": {
"abstract-level": "^1.0.3",
"datastore-core": "^8.0.1",
"interface-datastore": "^7.0.0",
"datastore-core": "^9.0.1",
"interface-datastore": "^8.0.0",
"it-filter": "^2.0.0",

@@ -176,12 +175,7 @@ "it-map": "^2.0.0",

"devDependencies": {
"@ipld/dag-cbor": "^8.0.0",
"@types/rimraf": "^3.0.2",
"aegir": "^37.5.1",
"interface-datastore-tests": "^3.0.0",
"aegir": "^38.1.7",
"interface-datastore-tests": "^4.0.0",
"ipfs-utils": "^9.0.4",
"level-mem": "^6.0.1",
"memory-level": "^1.0.0",
"multiformats": "^10.0.2",
"rimraf": "^3.0.2"
"memory-level": "^1.0.0"
}
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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