Skip to content

Commit

Permalink
Remove unused code and dependencies (#144)
Browse files Browse the repository at this point in the history
- Removed unused code
- Removed unused dependencies
- Updated dependencies
- Bumped version
  • Loading branch information
oderayi authored Dec 11, 2019
1 parent 77a2ae5 commit 2e6c9f6
Show file tree
Hide file tree
Showing 8 changed files with 360 additions and 580 deletions.
913 changes: 348 additions & 565 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
},
"homepage": "https://github.com/mojaloop/central-services-shared#readme",
"dependencies": {
"@mojaloop/central-services-stream": "8.4.0",
"@hapi/catbox": "10.2.3",
"@hapi/catbox-memory": "4.1.1",
"@mojaloop/central-services-error-handling": "8.6.2",
Expand All @@ -51,20 +50,18 @@
"base64url": "3.0.1",
"clone": "2.1.2",
"data-urls": "1.1.0",
"glob": "7.1.6",
"immutable": "3.8.2",
"lodash": "4.17.15",
"mustache": "3.1.0",
"raw-body": "2.4.1"
},
"devDependencies": {
"@modusbox/mojaloop-sdk-standard-components": "0.0.39",
"@hapi/hapi": "18.4.0",
"@hapi/joi": "16.1.8",
"chance": "1.1.4",
"faucet": "0.0.1",
"npm-audit-resolver": "2.1.0",
"npm-check-updates": "3.2.2",
"npm-check-updates": "4.0.1",
"nyc": "14.1.1",
"pre-commit": "1.2.2",
"proxyquire": "2.1.3",
Expand Down
2 changes: 1 addition & 1 deletion src/util/hapi/plugins/rawPayloadToDataUri.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ module.exports.plugin = {
request = requestRawPayloadTransform(request, rawBuffer)
}
return h.continue
}).catch(e => {
}).catch(() => {
return h.continue
})
}
Expand Down
4 changes: 2 additions & 2 deletions src/util/time.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict'

const sleep = (milliseconds = 10, debug = false, caller = null, reason = null) => {
const sleep = (milliseconds = 10) => {
const start = new Date().getTime()
while (1) {
while (true) {
if ((new Date().getTime() - start) > milliseconds) {
break
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Test('Duplicate check comparator', dccTest => {
})
const id = 1
const object = { key: 'value' }
const getDuplicateDataFuncOverride = async (id) => { return Promise.resolve(null) }
const getDuplicateDataFuncOverride = async () => { return Promise.resolve(null) }
const saveHashFuncOverride = async () => { return true }

const expected = {
Expand Down
10 changes: 5 additions & 5 deletions test/unit/util/hapi/plugins/eventPlugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Test('Event plugin test', async (pluginTest) => {
server.route({
method: 'POST',
path: '/',
handler: (request, h) => {
handler: (request) => {
span = request.span
return 'testing'
},
Expand Down Expand Up @@ -89,7 +89,7 @@ Test('Event plugin test', async (pluginTest) => {
server.route({
method: 'POST',
path: '/',
handler: (request, h) => {
handler: (request) => {
span = request.span
return 'testing'
},
Expand Down Expand Up @@ -129,7 +129,7 @@ Test('Event plugin test', async (pluginTest) => {
server.route({
method: 'POST',
path: '/',
handler: (request, h) => {
handler: (request) => {
span = request.span
return 'testing'
},
Expand Down Expand Up @@ -158,7 +158,7 @@ Test('Event plugin test', async (pluginTest) => {
server.route({
method: 'POST',
path: '/',
handler: (request, h) => {
handler: (request) => {
span = request.span
throw Error('testing')
},
Expand Down Expand Up @@ -190,7 +190,7 @@ Test('Event plugin test', async (pluginTest) => {
server.route({
method: 'POST',
path: '/',
handler: (request, h) => {
handler: (request) => {
span = request.span
throw Error('testing')
},
Expand Down
2 changes: 1 addition & 1 deletion test/unit/util/hapi/plugins/eventPluginIsolated.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Test('Event plugin test', async (pluginTest) => {
server.route({
method: 'POST',
path: '/',
handler: (request, h) => {
handler: (request) => {
span = request.span
throw Error('testing')
},
Expand Down
2 changes: 1 addition & 1 deletion test/unit/util/hapi/plugins/rawPayloadToDataUri.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const init = async (options) => {
server.route({
method: 'POST',
path: '/',
handler: (request, h) => {
handler: (request) => {
return {
payload: request.payload,
dataUri: request.dataUri,
Expand Down

0 comments on commit 2e6c9f6

Please sign in to comment.