Skip to content

Commit

Permalink
Modernize syntax and bump devDependencies (Level/community#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
vweevers committed Apr 17, 2021
1 parent 53bd922 commit d001b2c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 27 deletions.
1 change: 1 addition & 0 deletions .airtap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ providers:
browsers:
- name: chromium
- name: firefox
- name: webkit
4 changes: 0 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,3 @@ updates:
interval: monthly
ignore:
- dependency-name: dependency-check
# Pinned for browser compat
- dependency-name: uuid
- dependency-name: airtap
- dependency-name: standard
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ Use this package to avoid having to explicitly install `leveldown` or `level-js`
**If you are upgrading:** please see [`UPGRADING.md`](UPGRADING.md).

```js
var level = require('level')
const level = require('level')

// 1) Create our database, supply location and options.
// This will create or open the underlying store.
var db = level('my-db')
const db = level('my-db')

// 2) Put a key & value
db.put('name', 'Level', function (err) {
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@
"hallmark": "^3.0.0",
"level-community": "^3.0.0",
"nyc": "^15.0.0",
"pinkie": "^2.0.4",
"standard": "^15.0.0",
"standard": "^16.0.3",
"tape": "^5.0.1",
"uuid": "^3.4.0",
"uuid": "^8.3.2",
"verify-travis-appveyor": "^3.0.0"
},
"funding": {
Expand Down
26 changes: 8 additions & 18 deletions test-browser.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
'use strict'

// Promise polyfill for IE and others.
if (typeof Promise !== 'function') {
global.Promise = require('pinkie')
}

var test = require('tape')
var uuid = require('uuid/v4')
var level = require('.')
const test = require('tape')
const { v4: uuid } = require('uuid')
const level = require('.')

require('level-packager/abstract/base-test')(test, level)
require('level-packager/abstract/db-values-test')(test, level)
Expand All @@ -19,7 +14,7 @@ function factory (opts) {
test('level put', function (t) {
t.plan(4)

var db = factory()
const db = factory()

db.put('name', 'level', function (err) {
t.ifError(err, 'no put error')
Expand All @@ -38,8 +33,8 @@ test('level put', function (t) {
test('level Buffer value', function (t) {
t.plan(5)

var db = factory({ valueEncoding: 'binary' })
var buf = Buffer.from('00ff', 'hex')
const db = factory({ valueEncoding: 'binary' })
const buf = Buffer.from('00ff', 'hex')

db.put('binary', buf, function (err) {
t.ifError(err, 'no put error')
Expand All @@ -57,13 +52,8 @@ test('level Buffer value', function (t) {
})

test('level Buffer key', function (t) {
var db = factory({ keyEncoding: 'binary' })
var key = Buffer.from('00ff', 'hex')

if (!db.supports.bufferKeys) {
t.pass('Environment does not support buffer keys')
return t.end()
}
const db = factory({ keyEncoding: 'binary' })
const key = Buffer.from('00ff', 'hex')

db.put(key, 'value', function (err) {
t.ifError(err, 'no put error')
Expand Down

0 comments on commit d001b2c

Please sign in to comment.