Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

Commit 8558fcd

Browse files
committed
fix: remove leftpad and cleanup
1 parent 60de9e4 commit 8558fcd

9 files changed

+49
-135
lines changed

.appveyor.yml

-23
This file was deleted.

.npmignore

-29
This file was deleted.

.travis.yml

+39-29
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,42 @@
1-
# Warning: This file is automatically synced from https://github.com/ipfs/ci-sync so if you want to change it, please change it there and ask someone to sync all repositories.
2-
sudo: false
31
language: node_js
2+
cache: npm
3+
stages:
4+
- check
5+
- test
6+
- cov
47

5-
matrix:
8+
node_js:
9+
- '10'
10+
- '12'
11+
12+
os:
13+
- linux
14+
- osx
15+
16+
script: npx nyc -s npm run test:node -- --bail
17+
after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov
18+
19+
jobs:
620
include:
7-
- node_js: 6
8-
env: CXX=g++-4.8
9-
- node_js: 8
10-
env: CXX=g++-4.8
11-
# - node_js: stable
12-
# env: CXX=g++-4.8
13-
14-
script:
15-
- npm run lint
16-
- npm run test
17-
- npm run coverage
18-
19-
before_script:
20-
- export DISPLAY=:99.0
21-
- sh -e /etc/init.d/xvfb start
22-
23-
after_success:
24-
- npm run coverage-publish
25-
26-
addons:
27-
firefox: 'latest'
28-
apt:
29-
sources:
30-
- ubuntu-toolchain-r-test
31-
packages:
32-
- g++-4.8
21+
- os: windows
22+
cache: false
23+
24+
- stage: check
25+
script:
26+
- npx aegir dep-check
27+
- npm run lint
28+
29+
- stage: test
30+
name: chrome
31+
addons:
32+
chrome: stable
33+
script: npx aegir test -t browser -t webworker
34+
35+
- stage: test
36+
name: firefox
37+
addons:
38+
firefox: latest
39+
script: npx aegir test -t browser -t webworker -- --browsers FirefoxHeadless
40+
41+
notifications:
42+
email: false

appveyor.yml

-29
This file was deleted.

ci/Jenkinsfile

-2
This file was deleted.

circle.yml

-15
This file was deleted.

package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
"coverage-publish": "aegir coverage --provider codecov",
1919
"docs": "aegir docs"
2020
},
21+
"files": [
22+
"src",
23+
"dist"
24+
],
2125
"repository": {
2226
"type": "git",
2327
"url": "git+https://github.com/ipfs/js-datastore-core.git"
@@ -35,15 +39,14 @@
3539
},
3640
"homepage": "https://github.com/ipfs/js-datastore-core#readme",
3741
"devDependencies": {
38-
"aegir": "^15.3.1",
42+
"aegir": "^18.2.2",
3943
"chai": "^4.2.0",
4044
"dirty-chai": "^2.0.1",
41-
"flow-bin": "~0.83.0"
45+
"flow-bin": "~0.98.1"
4246
},
4347
"dependencies": {
4448
"async": "^2.6.1",
4549
"interface-datastore": "~0.6.0",
46-
"left-pad": "^1.3.0",
4750
"pull-many": "^1.0.8",
4851
"pull-stream": "^3.6.9"
4952
},

src/shard.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* @flow */
22
'use strict'
33

4-
const leftPad = require('left-pad')
54
const Key = require('interface-datastore').Key
65

76
const readme = require('./shard-readme')
@@ -42,7 +41,7 @@ class Shard {
4241
class Prefix extends Shard {
4342
constructor (prefixLen /* : number */) {
4443
super(prefixLen)
45-
this._padding = leftPad('', prefixLen, '_')
44+
this._padding = ''.padStart(prefixLen, '_')
4645
this.name = 'prefix'
4746
}
4847

@@ -54,7 +53,7 @@ class Prefix extends Shard {
5453
class Suffix extends Shard {
5554
constructor (suffixLen /* : number */) {
5655
super(suffixLen)
57-
this._padding = leftPad('', suffixLen, '_')
56+
this._padding = ''.padStart(suffixLen, '_')
5857
this.name = 'suffix'
5958
}
6059

@@ -67,7 +66,7 @@ class Suffix extends Shard {
6766
class NextToLast extends Shard {
6867
constructor (suffixLen /* : number */) {
6968
super(suffixLen)
70-
this._padding = leftPad('', suffixLen + 1, '_')
69+
this._padding = ''.padStart(suffixLen + 1, '_')
7170
this.name = 'next-to-last'
7271
}
7372

test/mount.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ describe('MountStore', () => {
126126
(cb) => m.put(new Key('/cool/hello'), val, cb),
127127
(cb) => {
128128
pull(
129-
m.query({prefix: '/cool'}),
129+
m.query({ prefix: '/cool' }),
130130
pull.collect((err, res) => {
131131
expect(err).to.not.exist()
132132
expect(res).to.eql([{

0 commit comments

Comments
 (0)