Skip to content

Commit

Permalink
feat: upgrade dependencies
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
This could break your code bc of the nano upgrade to v9 (via nano-option). Please refer to [nano documentation](https://github.com/apache/couchdb-nano/).

Updated packages:
* async              ^2.6.0  →    ^3.2.0
* couchdb-compile   ^1.10.0  →   ^1.11.0
* nano-option        ^1.3.0  →    ^2.0.0
* nano               ^6.4.3  →    ^9.0.3
* standard          ^11.0.0  →   ^16.0.3
* tap              ^14.10.7  →  ^14.11.0
  • Loading branch information
jo committed Feb 28, 2021
1 parent 0a8b8e8 commit 17544ab
Show file tree
Hide file tree
Showing 5 changed files with 2,958 additions and 4,224 deletions.
8 changes: 4 additions & 4 deletions cli.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/usr/bin/env node

var configure = require('./')
const configure = require('./')

var args = process.argv.slice(2)
const args = process.argv.slice(2)
if (!args.length) {
console.log('Usage: \ncouchdb-configure URL [SOURCE]')
process.exit()
}

var url = args[0]
var source = args[1] || process.cwd()
const url = args[0]
const source = args[1] || process.cwd()

configure(url, source, function (error, response) {
if (error) return console.error(error)
Expand Down
18 changes: 9 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
var nanoOption = require('nano-option')
var async = require('async')
var compile = require('couchdb-compile')
var assert = require('assert')
const nanoOption = require('nano-option')
const async = require('async')
const compile = require('couchdb-compile')
const assert = require('assert')

module.exports = function configure (url, source, callback) {
var couch = nanoOption(url)
const couch = nanoOption(url)

assert(typeof couch.request === 'function',
'URL must point to the root of a CouchDB server (not to a database).')
Expand All @@ -22,11 +22,11 @@ module.exports = function configure (url, source, callback) {
async.waterfall([
compile.bind(null, source, { index: true }),
(config, done) => {
var settings = Object.keys(config)
const settings = Object.keys(config)
.reduce(function (memo, key) {
if (typeof config[key] !== 'object') return memo

var section = Object.keys(config[key])
const section = Object.keys(config[key])
.map(function (k) {
return {
path: encodeURIComponent(key) + '/' + encodeURIComponent(k),
Expand All @@ -42,7 +42,7 @@ module.exports = function configure (url, source, callback) {
}
], done)
},
([ version, settings ], done) => {
([version, settings], done) => {
function writeConfig (configPath, done) {
async.map(settings, (setting, done) => {
couch.request({
Expand Down Expand Up @@ -76,7 +76,7 @@ module.exports = function configure (url, source, callback) {
}
},
(responses, done) => {
var response = responses.reduce(function (memo, response) {
const response = responses.reduce(function (memo, response) {
memo[response.path] = {
ok: true,
value: response.value
Expand Down
Loading

0 comments on commit 17544ab

Please sign in to comment.