Skip to content

Commit

Permalink
utils: Remove exported utils and use mono-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Atinux committed May 24, 2018
1 parent fc98494 commit 23be3e2
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 230 deletions.
2 changes: 1 addition & 1 deletion lib/hooks.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const debug = require('debug')('mono:hooks')
const { asyncForEach } = require('mono-utils')

const HttpError = require('./http-error')
const { asyncForEach } = require('./utils')


class Hooks {
Expand Down
2 changes: 0 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const loadRoutes = require('./routes')
const initJWT = require('./jwt')
const { jwt } = require('./jwt')
const HttpError = require('./http-error')
const utils = require('./utils')
const loadConf = require('./conf')
const MonoLog = require('./log')
const Hooks = require('./hooks')
Expand Down Expand Up @@ -92,5 +91,4 @@ module.exports.conf = {}
module.exports.imperium = imperium
module.exports.HttpError = HttpError
module.exports.UnauthorizedError = imperium.UnauthorizedError
module.exports.utils = utils
module.exports.jwt = jwt
2 changes: 1 addition & 1 deletion lib/jwt.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const debug = require('debug')('mono:jwt')
const jsonwebtoken = require('jsonwebtoken')
const { cb } = require('mono-utils')

const HttpError = require('./http-error')
const { cb } = require('./utils')

async function generateJWT(session) {
if (!session) {
Expand Down
71 changes: 0 additions & 71 deletions lib/utils.js

This file was deleted.

2 changes: 1 addition & 1 deletion test/log.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const test = require('ava')
const { join } = require('path')
const { readFileSync } = require('fs')
const { waitFor } = require('../utils')
const { waitFor } = require('mono-utils')

const { start, stop, stdMock, stdRestore, $get } = require('mono-test-utils')
const monoPath = join(__dirname, '..')
Expand Down
2 changes: 1 addition & 1 deletion test/sessions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const jsonwebtoken = require('jsonwebtoken')
const { join } = require('path')
const { start, stop, $get, $post } = require('mono-test-utils')

const { cb } = require('../utils')
const { cb } = require('mono-utils')
const monoPath = join(__dirname, '..')

let ctx
Expand Down
151 changes: 0 additions & 151 deletions test/utils.test.js

This file was deleted.

2 changes: 0 additions & 2 deletions utils.js

This file was deleted.

0 comments on commit 23be3e2

Please sign in to comment.