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

subleveldown

Package Overview
Dependencies
Maintainers
4
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

subleveldown - npm Package Compare versions

Comparing version 3.0.0-rc1 to 3.0.0

17

CHANGELOG.md

@@ -5,5 +5,17 @@ # Changelog

## [v3.0.0-rc1]
## [3.0.0] - 2018-06-07
### Added
* Test that iterator options are forwarded (@ralphtheninja)
* Test concatenating Buffer keys (@ralphtheninja)
### Changed
* Call `cleanup()` cb synchronously (@ralphtheninja)
### Removed
* Remove `makeExistingDbTest()` from `test/common.js` (@ralphtheninja)
## [3.0.0-rc1] - 2018-06-03
### Changed
* Upgrade `levelup` from `^1.2.1` to `^3.0.1` (@ralphtheninja)

@@ -106,3 +118,4 @@ * Upgrade `abstract-leveldown` from `^2.4.1` to `^5.0.0` (@ralphtheninja)

[Unreleased]: https://github.com/level/subleveldown/compare/v3.0.0-rc1...HEAD
[Unreleased]: https://github.com/level/subleveldown/compare/v3.0.0...HEAD
[3.0.0]: https://github.com/level/subleveldown/compare/v3.0.0-rc1...v3.0.0
[3.0.0-rc1]: https://github.com/level/subleveldown/compare/v2.1.0...v3.0.0-rc1

@@ -109,0 +122,0 @@ [2.1.0]: https://github.com/level/subleveldown/compare/v2.0.0...v2.1.0

2

package.json
{
"name": "subleveldown",
"version": "3.0.0-rc1",
"version": "3.0.0",
"description": "sublevels implemented using leveldowns",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -9,4 +9,3 @@ var dbidx = 0

tearDown: tearDown,
collectEntries: collectEntries,
makeExistingDbTest: makeExistingDbTest
collectEntries: collectEntries
}

@@ -23,3 +22,3 @@

function cleanup (callback) {
callback()
process.nextTick(callback)
}

@@ -55,30 +54,1 @@

}
function makeExistingDbTest (name, test, leveldown, testFn) {
test(name, function (t) {
cleanup(function () {
var loc = location()
var db = leveldown(loc)
db.open(function (err) {
t.notOk(err, 'no error from open()')
db.batch([
{type: 'put', key: 'one', value: '1'},
{type: 'put', key: 'two', value: '2'},
{type: 'put', key: 'three', value: '3'}
], function (err) {
t.notOk(err, 'no error from batch()')
testFn(db, t, done, loc)
})
})
function done (close) {
if (close === false) return cleanup(t.end.bind(t))
db.close(function (err) {
t.notOk(err, 'no error from close()')
cleanup(t.end.bind(t))
})
}
})
})
}

@@ -141,2 +141,35 @@ var test = require('tape')

})
t.test('iterator options are forwarded (issue #1)', function (t) {
t.plan(4)
var enc = { keyEncoding: 'utf8', valueEncoding: 'json' }
var db = levelup(encoding(memdown(), enc))
var sub = subdb(db, 'test', enc)
var key = 'foo'
var value = { hello: 'world' }
sub.once('open', function () {
sub.put(key, value, function () {
db.createReadStream().on('data', function (r) {
t.is(r.key, '!test!' + key, 'db key is utf8')
t.deepEqual(r.value, value, 'db value is json')
})
sub.createReadStream().on('data', function (r) {
t.is(r.key, key, 'sub db key is utf8')
t.deepEqual(r.value, value, 'db value is json')
})
})
})
})
t.test('concatenating Buffer keys', function (t) {
t.plan(1)
var db = levelup(memdown())
var sub = subdb(db, 'test', { keyEncoding: 'binary' })
var key = Buffer.from('00ff', 'hex')
sub.once('open', function () {
sub.put(key, 'bar', function () {
db.createReadStream().on('data', function (r) {
t.deepEqual(r.key, Buffer.concat([Buffer.from('!test!'), key]))
})
})
})
})
})

@@ -143,0 +176,0 @@

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