diff --git a/lib/levelup.js b/lib/levelup.js index fab316f4..aafa5a8c 100644 --- a/lib/levelup.js +++ b/lib/levelup.js @@ -2,7 +2,6 @@ const EventEmitter = require('events').EventEmitter const inherits = require('util').inherits -const extend = require('xtend') const DeferredLevelDOWN = require('deferred-leveldown') const IteratorStream = require('level-iterator-stream') const Batch = require('./batch') @@ -277,19 +276,19 @@ LevelUP.prototype.clear = function (options, callback) { LevelUP.prototype.readStream = LevelUP.prototype.createReadStream = function (options) { - options = extend({ keys: true, values: true }, options) + options = Object.assign({ keys: true, values: true }, options) if (typeof options.limit !== 'number') { options.limit = -1 } return new IteratorStream(this.db.iterator(options), options) } LevelUP.prototype.keyStream = LevelUP.prototype.createKeyStream = function (options) { - return this.createReadStream(extend(options, { keys: true, values: false })) + return this.createReadStream(Object.assign({}, options, { keys: true, values: false })) } LevelUP.prototype.valueStream = LevelUP.prototype.createValueStream = function (options) { - return this.createReadStream(extend(options, { keys: false, values: true })) + return this.createReadStream(Object.assign({}, options, { keys: false, values: true })) } LevelUP.prototype.toString = function () { diff --git a/package.json b/package.json index 2f8f7470..d0b29870 100644 --- a/package.json +++ b/package.json @@ -18,8 +18,7 @@ "deferred-leveldown": "~5.3.0", "level-errors": "^3.0.0", "level-iterator-stream": "^5.0.0", - "level-supports": "^2.0.0", - "xtend": "~4.0.0" + "level-supports": "^2.0.0" }, "devDependencies": { "after": "^0.8.2", diff --git a/test/util/rs-factory.js b/test/util/rs-factory.js index 2cfa7dbf..876f1260 100644 --- a/test/util/rs-factory.js +++ b/test/util/rs-factory.js @@ -1,11 +1,9 @@ 'use strict' -const xtend = require('xtend') - module.exports = function (testCommon) { return function createReadStream (db, options) { if (!testCommon.encodings) { - options = xtend(options, { + options = Object.assign({}, options, { keyAsBuffer: false, valueAsBuffer: false })