Skip to content

Commit

Permalink
Replace xtend dependency with Object.assign()
Browse files Browse the repository at this point in the history
  • Loading branch information
vweevers committed Apr 9, 2021
1 parent 979d34f commit 9d4171f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions abstract-leveldown.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
var xtend = require('xtend')
var supports = require('level-supports')
var Buffer = require('buffer').Buffer
var AbstractIterator = require('./abstract-iterator')
Expand Down Expand Up @@ -163,7 +162,7 @@ AbstractLevelDOWN.prototype.batch = function (array, options, callback) {
return nextTick(callback, new Error('batch(array) element must be an object and not `null`'))
}

var e = xtend(array[i])
var e = Object.assign({}, array[i])

if (e.type !== 'put' && e.type !== 'del') {
return nextTick(callback, new Error("`type` must be 'put' or 'del'"))
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
"buffer": "^6.0.3",
"immediate": "^3.2.3",
"level-concat-iterator": "~2.0.0",
"level-supports": "~1.0.0",
"xtend": "~4.0.0"
"level-supports": "~1.0.0"
},
"devDependencies": {
"airtap": "^4.0.3",
Expand Down
3 changes: 1 addition & 2 deletions test/iterator-range-test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
var collectEntries = require('level-concat-iterator')
var xtend = require('xtend')

var db

Expand Down Expand Up @@ -50,7 +49,7 @@ exports.range = function (test, testCommon) {
// Test the documented promise that in reverse mode,
// "the returned entries are the same, but in reverse".
if (!opts.reverse && !('limit' in opts)) {
var reverseOpts = xtend(opts, { reverse: true })
var reverseOpts = Object.assign({}, opts, { reverse: true })

rangeTest(
name + ' (flipped)',
Expand Down

0 comments on commit 9d4171f

Please sign in to comment.