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

@adorsys/encrypt-down

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adorsys/encrypt-down - npm Package Compare versions

Comparing version 1.1.0 to 2.0.0

10

package.json
{
"name": "@adorsys/encrypt-down",
"version": "1.1.0",
"version": "2.0.0",
"description": "Encryption layer for level-db",

@@ -36,6 +36,5 @@ "main": "src/index.js",

"format": "prettier-standard '**/*.js'",
"test": "ava",
"test": "nyc --reporter=lcov --reporter=text ava",
"test:integ-browser": "airtap --local test/integrations/leveljs.test.js",
"test:integ": "tape test/integrations/leveldown.test.js test/integrations/memdown.test.js | tap-spec",
"test:cover": "nyc --reporter=lcov ava",
"coverage": "nyc report --reporter=text-lcov | coveralls",

@@ -66,3 +65,3 @@ "build": "browserify -s encryptdown -e src/index.js -o dist/lib.js",

"@adorsys/jwe-codec": "1.0.0",
"abstract-leveldown": "5.0.0",
"abstract-leveldown": "6.0.0",
"inherits": "2.0.3",

@@ -78,5 +77,7 @@ "node-jose": "1.0.0"

"coveralls": "3.0.2",
"cuid": "2.1.4",
"eslint-plugin-html": "4.0.5",
"eslint-plugin-markdown": "1.0.0-beta.6",
"husky": "1.0.0-rc.15",
"level-concat-iterator": "2.0.0",
"level-js": "3.0.0",

@@ -93,4 +94,5 @@ "leveldown": "4.0.1",

"tape": "4.9.1",
"tempy": "0.2.1",
"travis-deploy-once": "^5.0.9"
}
}

2

src/index.js

@@ -15,3 +15,3 @@ 'use strict'

}
AbstractLevelDOWN.call(this, '')
AbstractLevelDOWN.call(this)

@@ -18,0 +18,0 @@ options = options || {}

const test = require('ava')
const memdown = require('memdown')
const testCommon = require('abstract-leveldown/testCommon')
const concat = require('level-concat-iterator')
const ltgt = require('ltgt')

@@ -10,3 +10,3 @@ const EncryptDown = require('../src')

test.beforeEach(async t => {
const db = new EncryptDown(memdown(), { jwk })
const db = EncryptDown(memdown(), { jwk })
const promised = promisify(db)

@@ -32,13 +32,10 @@ t.context.db = db

test.cb('null value', t => {
test.cb('not specifying a jwk raises an error', t => {
;(async () => {
const promisedDB = t.context.promisedDB
await promisedDB.open()
await promisedDB.put('foo', null)
const value1 = await promisedDB.get('foo')
t.is(value1.toString(), '', 'nulls are equal')
const value2 = await promisedDB.get('foo', { asBuffer: false })
t.is(value2, '', 'nulls are equal')
t.throws(
() => EncryptDown(memdown(), {}),
'EncryptDown: a JsonWebKey is required!',
'correct Error is thrown'
)
t.end()
t.pass('ok')
})()

@@ -62,3 +59,3 @@ })

])
testCommon.collectEntries(
concat(
promisedDB.db.iterator({ keyAsBuffer: false, valueAsBuffer: false }),

@@ -221,3 +218,3 @@ function (err, data) {

testCommon.collectEntries(promisedDB.db.iterator(), function (err, entries) {
concat(promisedDB.db.iterator(), function (err, entries) {
t.falsy(err, 'no iterator error')

@@ -236,3 +233,3 @@ t.true(entries[0].key === buf, 'key is same buffer')

testCommon.collectEntries(promisedDB.db.iterator(), function (err, entries) {
concat(promisedDB.db.iterator(), function (err, entries) {
t.falsy(err, 'no iterator error')

@@ -363,7 +360,7 @@ t.deepEqual(entries[0].key, Buffer.from('1'), 'key is stringified')

testCommon.collectEntries(iterator1, function (err, entries) {
concat(iterator1, function (err, entries) {
t.falsy(err, 'no iterator error')
t.deepEqual(entries.map(getKey), numbers, 'sorts naturally')
testCommon.collectEntries(iterator2, function (err, entries) {
concat(iterator2, function (err, entries) {
t.falsy(err, 'no iterator error')

@@ -389,7 +386,7 @@ t.deepEqual(entries.map(getKey), buffers, 'buffer input is stringified')

testCommon.collectEntries(iterator, function (err, entries) {
concat(iterator, function (err, entries) {
t.falsy(err, 'no iterator error')
t.deepEqual(entries.map(getKey), dates, 'sorts naturally')
testCommon.collectEntries(iterator2, function (err, entries) {
concat(iterator2, function (err, entries) {
t.falsy(err, 'no iterator error')

@@ -396,0 +393,0 @@ t.deepEqual(entries.map(getKey), buffers, 'buffer input is stringified')

const test = require('tape')
const testCommon = require('abstract-leveldown/testCommon')
const tempy = require('tempy')
const suite = require('abstract-leveldown/test')
const leveldown = require('leveldown')
const jwk = require('../jwk.json')
const EncryptDown = require('../../src')
const jwk = require('../jwk.json')
const factory = location => new EncryptDown(leveldown(location), { jwk })
/** compatibility with basic LevelDOWN API **/
test('integration with leveldown', t => {
require('abstract-leveldown/abstract/leveldown-test').args(factory, test)
require('abstract-leveldown/abstract/open-test').all(
factory,
t.test,
testCommon
)
require('abstract-leveldown/abstract/del-test').all(factory, t.test)
require('abstract-leveldown/abstract/get-test').all(factory, t.test)
require('abstract-leveldown/abstract/put-test').all(factory, t.test)
require('abstract-leveldown/abstract/put-get-del-test').all(factory, t.test)
require('abstract-leveldown/abstract/batch-test').all(factory, t.test)
require('abstract-leveldown/abstract/chained-batch-test').all(factory, t.test)
require('abstract-leveldown/abstract/close-test').close(factory, t.test)
require('abstract-leveldown/abstract/iterator-test').all(factory, t.test)
require('abstract-leveldown/abstract/iterator-range-test').all(
factory,
t.test
)
suite({
test: test,
factory: function () {
return new EncryptDown(leveldown(tempy.directory()), { jwk })
},
seek: false
})
const test = require('tape')
const testCommon = require('abstract-leveldown/testCommon')
const cuid = require('cuid')
const suite = require('abstract-leveldown/test')
const leveljs = require('level-js')
const jwk = require('../jwk.json')
const EncryptDown = require('../../src')
const jwk = require('../jwk.json')
const factory = location => new EncryptDown(leveljs(location), { jwk })
/** compatibility with basic LevelDOWN API **/
test('integration with leveldown', t => {
require('abstract-leveldown/abstract/leveldown-test').args(factory, test)
require('abstract-leveldown/abstract/open-test').open(
factory,
t.test,
testCommon
)
require('abstract-leveldown/abstract/del-test').all(factory, t.test)
require('abstract-leveldown/abstract/get-test').all(factory, t.test)
require('abstract-leveldown/abstract/put-test').all(factory, t.test)
require('abstract-leveldown/abstract/put-get-del-test').all(factory, t.test)
require('abstract-leveldown/abstract/batch-test').all(factory, t.test)
require('abstract-leveldown/abstract/chained-batch-test').all(factory, t.test)
require('abstract-leveldown/abstract/close-test').close(factory, t.test)
require('abstract-leveldown/abstract/iterator-test').all(factory, t.test)
require('abstract-leveldown/abstract/iterator-range-test').all(
factory,
t.test
)
suite({
test: test,
factory: function () {
return new EncryptDown(leveljs(cuid()), { jwk })
},
seek: false,
createIfMissing: false,
errorIfExists: false
})
const test = require('tape')
const testCommon = require('abstract-leveldown/testCommon')
const suite = require('abstract-leveldown/test')
const memdown = require('memdown')
const jwk = require('../jwk.json')
const EncryptDown = require('../../src')
const jwk = require('../jwk.json')
const factory = location => new EncryptDown(memdown(), { jwk })
/** compatibility with basic LevelDOWN API **/
test('integration with memdown', t => {
// require('abstract-leveldown/abstract/leveldown-test').args(factory, test)
require('abstract-leveldown/abstract/open-test').args(
factory,
t.test,
testCommon
)
require('abstract-leveldown/abstract/open-test').open(
factory,
t.test,
testCommon
)
require('abstract-leveldown/abstract/del-test').all(factory, t.test)
require('abstract-leveldown/abstract/get-test').all(factory, t.test)
require('abstract-leveldown/abstract/put-test').all(factory, t.test)
require('abstract-leveldown/abstract/put-get-del-test').all(factory, t.test)
require('abstract-leveldown/abstract/batch-test').all(factory, t.test)
require('abstract-leveldown/abstract/chained-batch-test').all(factory, t.test)
require('abstract-leveldown/abstract/close-test').close(factory, t.test)
require('abstract-leveldown/abstract/iterator-test').all(factory, t.test)
require('abstract-leveldown/abstract/iterator-range-test').all(
factory,
t.test
)
suite({
test: test,
factory: function () {
return new EncryptDown(memdown(), { jwk })
},
seek: false,
createIfMissing: false,
errorIfExists: false
})

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

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