Skip to content
This repository was archived by the owner on Oct 1, 2021. It is now read-only.

Commit 43d0066

Browse files
committed
Linting
1 parent f5f3ddf commit 43d0066

File tree

8 files changed

+20
-23
lines changed

8 files changed

+20
-23
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757
"dependencies": {
5858
"chalk": "^2.4.2",
5959
"debug": "^4.1.0",
60-
"datastore-fs": "^0.9.0",
61-
"datastore-level": "^0.12.0",
62-
"interface-datastore": "^0.7.0",
60+
"datastore-fs": "~0.9.0",
61+
"datastore-level": "~0.12.0",
62+
"interface-datastore": "~0.7.0",
6363
"proper-lockfile": "^3.2.0",
6464
"yargs": "^12.0.5",
6565
"yargs-promise": "^1.1.0"

src/commands.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async function migrate ({ repoPath, to, dry, revertOk }) {
4040

4141
if (!to || (version <= to)) {
4242
await migrator.migrate(repoPath, options)
43-
} else if(revertOk){
43+
} else if (revertOk) {
4444
await migrator.revert(repoPath, to, options)
4545
} else {
4646
throw new Error('The migration would require reversion of the repo, but you have not allowed it as \'--revert-ok\' is not present.')

src/errors.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,3 @@ class InvalidValueError extends Error {
7575

7676
InvalidValueError.code = 'ERR_INVALID_VALUE'
7777
exports.InvalidValueError = InvalidValueError
78-

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ exports.getLatestMigrationVersion = getLatestMigrationVersion
4646
* @param {array?} options.migrations - Array of migrations to migrate. If undefined, the bundled migrations are used. Mainly for testing purpose.
4747
* @returns {Promise<void>}
4848
*/
49-
async function migrate (path, {toVersion, ignoreLock=false, repoOptions, onProgress, isDryRun=false, migrations}) {
49+
async function migrate (path, { toVersion, ignoreLock = false, repoOptions, onProgress, isDryRun = false, migrations }) {
5050
migrations = migrations || defaultMigrations
5151

5252
if (!path) {
@@ -125,7 +125,7 @@ exports.migrate = migrate
125125
* @param {array?} options.migrations - Array of migrations to migrate. If undefined, the bundled migrations are used. Mainly for testing purpose.
126126
* @returns {Promise<void>}
127127
*/
128-
async function revert (path, toVersion, {ignoreLock=false, repoOptions, onProgress, isDryRun=false, migrations}) {
128+
async function revert (path, toVersion, { ignoreLock = false, repoOptions, onProgress, isDryRun = false, migrations }) {
129129
migrations = migrations || defaultMigrations
130130

131131
if (!path) {

test/index.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ describe('index.js', () => {
220220
it('should not lock repo when ignoreLock is used', async () => {
221221
const options = createOptions()
222222
options.ignoreLock = true
223-
223+
224224
getVersionStub.returns(4)
225225

226226
await expect(migrator.revert('/some/path', 2, options))

test/init-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module.exports = (setup, cleanup) => {
3737
await store.put(configKey, '')
3838
await store.close()
3939

40-
expect( await repoInit.isRepoInitialized(dir)).to.be.false()
40+
expect(await repoInit.isRepoInitialized(dir)).to.be.false()
4141
})
4242

4343
it('should return false with missing config key', async () => {

test/integration-test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ const CONFIG_KEY = new Key('config')
1313
const VERSION_KEY = new Key('version')
1414

1515
module.exports = (setup, cleanup) => {
16-
1716
let dir
1817

1918
beforeEach(async () => {

test/test-migrations/migration-2/index.js

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
const Datastore = require('datastore-fs')
44
const path = require('path')
55
const Key = require('interface-datastore').Key
6-
const log = require('debug')('ipfs-repo-migrations:migration-8')
76
const _set = require('just-safe-set')
87

98
const CONFIG_KEY = new Key('config')
@@ -19,26 +18,26 @@ const NEW_API_ADDRESS = '/ip6/::/tcp/5001'
1918
*/
2019

2120
function datastoreFactory (repoPath, options) {
22-
let storageBackend, storageBackendOptions
23-
if (options !== undefined
24-
&& options['storageBackends'] !== undefined
25-
&& options['storageBackends']['root'] !== undefined
21+
let StorageBackend, storageBackendOptions
22+
if (options !== undefined &&
23+
options.storageBackends !== undefined &&
24+
options.storageBackends.root !== undefined
2625
) {
27-
storageBackend = options['storageBackends']['root']
26+
StorageBackend = options.storageBackends.root
2827
} else {
29-
storageBackend = Datastore
28+
StorageBackend = Datastore
3029
}
3130

32-
if (options !== undefined
33-
&& options['storageBackendOptions'] !== undefined
34-
&& options['storageBackendOptions']['root'] !== undefined
31+
if (options !== undefined &&
32+
options.storageBackendOptions !== undefined &&
33+
options.storageBackendOptions.root !== undefined
3534
) {
36-
storageBackendOptions = options['storageBackends']['root']
35+
storageBackendOptions = options.storageBackendOptions.root
3736
} else {
38-
storageBackendOptions = { 'extension': '' }
37+
storageBackendOptions = { extension: '' }
3938
}
4039

41-
return new storageBackend(path.join(repoPath), storageBackendOptions)
40+
return new StorageBackend(path.join(repoPath), storageBackendOptions)
4241
}
4342

4443
function addNewApiAddress (config) {

0 commit comments

Comments
 (0)