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

level-packager

Package Overview
Dependencies
Maintainers
4
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

level-packager - npm Package Compare versions

Comparing version 3.1.0 to 4.0.0

5

abstract/base-test.js
var location = require('./location')
module.exports = function (test, level) {
test('Level constructor provides access to levelup errors', function (t) {
t.ok(level.errors, '.errors property set on constructor')
t.end()
})
test('test db open and use, level(location, cb)', function (t) {

@@ -10,0 +5,0 @@ level(location, function (err, db) {

8

CHANGELOG.md

@@ -5,2 +5,7 @@ # Changelog

## [4.0.0] - 2018-06-13
### Changed
* Rewrite `test.js` to test `level-packager` api (@ralphtheninja)
## [3.1.0] - 2018-05-28

@@ -243,3 +248,4 @@

[Unreleased]: https://github.com/level/packager/compare/v3.1.0...HEAD
[Unreleased]: https://github.com/level/packager/compare/v4.0.0...HEAD
[4.0.0]: https://github.com/level/packager/compare/v3.1.0...v4.0.0
[3.1.0]: https://github.com/level/packager/compare/v3.0.0...v3.1.0

@@ -246,0 +252,0 @@ [3.0.0]: https://github.com/level/packager/compare/v2.1.1...v3.0.0

{
"name": "level-packager",
"description": "LevelUP package helper for distributing with a LevelDOWN-compatible back-end",
"version": "3.1.0",
"version": "4.0.0",
"contributors": [

@@ -25,3 +25,3 @@ "Rod Vagg <r@va.gg> (https://github.com/rvagg)",

"scripts": {
"test": "standard && node test.js && rm -rf abstract/level-test*"
"test": "standard && node test.js"
},

@@ -45,3 +45,2 @@ "homepage": "https://github.com/Level/packager",

"devDependencies": {
"leveldown": "^4.0.0",
"standard": "^11.0.0",

@@ -48,0 +47,0 @@ "tape": "^4.0.0"

@@ -42,3 +42,3 @@ # level-packager

Copyright (c) 2012-2018 `level-packager` [contributors](https://github.com/level/community#contributors).
Copyright (c) 2012-present `level-packager` [contributors](https://github.com/level/community#contributors).

@@ -45,0 +45,0 @@ `level-packager` is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included `LICENSE.md` file for more details.

'use strict'
module.exports = require('./abstract/test')
var test = require('tape')
var packager = require('.')
if (!module.parent) {
var test = require('tape')
var packager = require('./')
var leveldown = require('leveldown')
module.exports(test, packager(leveldown))
}
test('Level constructor has access to levelup errors', function (t) {
function Down () {}
t.ok(packager(Down).errors, '.errors property set on constructor')
t.end()
})
test('Level constructor relays .destroy if it exists', function (t) {
t.plan(2)
function Down () {}
Down.destroy = function (location, cb) {
t.is(location, 'location', 'location is correct')
t.is(typeof cb, 'function', 'cb is set')
}
packager(Down).destroy('location')
})
test('Level constructor relays .repair if it exists', function (t) {
t.plan(2)
function Down () {}
Down.repair = function (location, cb) {
t.is(location, 'location', 'location is correct')
t.is(typeof cb, 'function', 'cb is set')
}
packager(Down).repair('location')
})
test('Level constructor, default options', function (t) {
t.plan(3)
function Down (location) {
t.is(location, 'location', 'location is correct')
return {
open: function (opts, cb) {}
}
}
var levelup = packager(Down)('location')
t.is(levelup.options.keyEncoding, 'utf8')
t.is(levelup.options.valueEncoding, 'utf8')
})
test('Level constructor, custom options', function (t) {
t.plan(3)
var Down = function (location) {
t.is(location, 'location', 'location is correct')
return {
open: function (opts, cb) {}
}
}
var levelup = packager(Down)('location', {
keyEncoding: 'binary',
valueEncoding: 'binary'
})
t.is(levelup.options.keyEncoding, 'binary')
t.is(levelup.options.valueEncoding, 'binary')
})

@@ -5,4 +5,8 @@ # Upgrade Guide

## v4
The `test.js` file was rewritten to test the `level-packager` api and is no longer part of the api. Implementations based on `level-packager` should instead use the tests in the `abstract/` folder.
## v3
Dropped support for node 4. No other breaking changes.

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