Skip to content

Commit d001b2c

Browse files
committed
Modernize syntax and bump devDependencies (Level/community#98)
1 parent 53bd922 commit d001b2c

File tree

5 files changed

+13
-27
lines changed

5 files changed

+13
-27
lines changed

.airtap.yml

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ providers:
44
browsers:
55
- name: chromium
66
- name: firefox
7+
- name: webkit

.github/dependabot.yml

-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,3 @@ updates:
66
interval: monthly
77
ignore:
88
- dependency-name: dependency-check
9-
# Pinned for browser compat
10-
- dependency-name: uuid
11-
- dependency-name: airtap
12-
- dependency-name: standard

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ Use this package to avoid having to explicitly install `leveldown` or `level-js`
4444
**If you are upgrading:** please see [`UPGRADING.md`](UPGRADING.md).
4545

4646
```js
47-
var level = require('level')
47+
const level = require('level')
4848

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

5353
// 2) Put a key & value
5454
db.put('name', 'Level', function (err) {

package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@
2626
"hallmark": "^3.0.0",
2727
"level-community": "^3.0.0",
2828
"nyc": "^15.0.0",
29-
"pinkie": "^2.0.4",
30-
"standard": "^15.0.0",
29+
"standard": "^16.0.3",
3130
"tape": "^5.0.1",
32-
"uuid": "^3.4.0",
31+
"uuid": "^8.3.2",
3332
"verify-travis-appveyor": "^3.0.0"
3433
},
3534
"funding": {

test-browser.js

+8-18
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
'use strict'
22

3-
// Promise polyfill for IE and others.
4-
if (typeof Promise !== 'function') {
5-
global.Promise = require('pinkie')
6-
}
7-
8-
var test = require('tape')
9-
var uuid = require('uuid/v4')
10-
var level = require('.')
3+
const test = require('tape')
4+
const { v4: uuid } = require('uuid')
5+
const level = require('.')
116

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

22-
var db = factory()
17+
const db = factory()
2318

2419
db.put('name', 'level', function (err) {
2520
t.ifError(err, 'no put error')
@@ -38,8 +33,8 @@ test('level put', function (t) {
3833
test('level Buffer value', function (t) {
3934
t.plan(5)
4035

41-
var db = factory({ valueEncoding: 'binary' })
42-
var buf = Buffer.from('00ff', 'hex')
36+
const db = factory({ valueEncoding: 'binary' })
37+
const buf = Buffer.from('00ff', 'hex')
4338

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

5954
test('level Buffer key', function (t) {
60-
var db = factory({ keyEncoding: 'binary' })
61-
var key = Buffer.from('00ff', 'hex')
62-
63-
if (!db.supports.bufferKeys) {
64-
t.pass('Environment does not support buffer keys')
65-
return t.end()
66-
}
55+
const db = factory({ keyEncoding: 'binary' })
56+
const key = Buffer.from('00ff', 'hex')
6757

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

0 commit comments

Comments
 (0)