Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { AbstractLevelDOWN } from 'abstract-leveldown';
const test = (levelDown: AbstractLevelDOWN) => {
levelDown.put("key", "value", (err?) => { });
levelDown.put(1, "value", { something: true }, (err?) => { });
levelDown.get("key", (err?) => { });
levelDown.get(1, { something: true }, (err?) => { });
};
// $ExpectType void
test(new AbstractLevelDOWN('here'));
// $ExpectType void
test(AbstractLevelDOWN('there'));
// $ExpectType void
test(new AbstractLevelDOWN('here'));
// $ExpectType void
test(AbstractLevelDOWN('there'));
import { AbstractLevelDOWN } from 'abstract-leveldown';
const test = (levelDown: AbstractLevelDOWN) => {
levelDown.put("key", "value", (err?) => { });
levelDown.put(1, "value", { something: true }, (err?) => { });
levelDown.get("key", (err?) => { });
levelDown.get(1, { something: true }, (err?) => { });
};
// $ExpectType void
test(new AbstractLevelDOWN('here'));
// $ExpectType void
test(AbstractLevelDOWN('there'));
// $ExpectType void
test(new AbstractLevelDOWN('here'));
// $ExpectType void
test(AbstractLevelDOWN('there'));
import levelup from 'levelup';
import { AbstractLevelDOWN } from 'abstract-leveldown';
interface StringEncoding {
encode(val: any): string;
decode(val: string): any;
buffer: boolean;
type: string;
}
declare const stringEncoding: StringEncoding;
const db = levelup(new AbstractLevelDOWN('here'), {
keyEncoding: stringEncoding,
valueEncoding: stringEncoding
});
db.open();
db.close();
db.open((error) => {
});
db.close((error) => {
});
db.put("key", {});
db.put("key", {}, (error) => {});
db.put("key", {}, { sync: true}, (error) => {});
, open = require('leveldown-open')
, MedeaIterator = require('./medeaiterator')
, MedeaDOWN = function (location) {
if (!(this instanceof MedeaDOWN))
return new MedeaDOWN(location)
AbstractLevelDOWN.call(this, location)
this.db = medea()
this.keys = keydir()
}
, setImmediate = global.setImmediate || process.nextTick
require('util').inherits(MedeaDOWN, AbstractLevelDOWN)
MedeaDOWN.prototype._open = function (options, callback) {
var self = this
open(this.location, options, function (err) {
if (err)
return callback(err)
self.db.open(self.location, function (err) {
if (err)
return callback(err)
self.db.listKeys(function (err, keys) {
keys.forEach(function (key) {
self.keys.put(key)
})