Skip to content

Commit

Permalink
feat: remove underscore.string #198
Browse files Browse the repository at this point in the history
  • Loading branch information
David Longworth committed Dec 1, 2017
1 parent c2095c0 commit a0d6d46
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
18 changes: 1 addition & 17 deletions dadi/lib/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ const config = require(path.join(__dirname, '/../../config.js'))
const Passport = require('@dadi/passport')
const errorView = require(path.join(__dirname, '/view/errors'))

var self = this

module.exports.getVersion = function () {
if (config.get('debug')) return version
}
Expand Down Expand Up @@ -245,28 +243,14 @@ module.exports.clearCache = function (req, Cache, callback) {
})
}

/**
* Creates a URL/filename friendly version (slug) of any object that implements `toString()`
* @param {Object} input - object to be slugified
*/
module.exports.slugify = function (input) {
return require('underscore.string').slugify(input.toString())
}

/**
* Generates a filename for a token wallet file
* @param {String} host - Issuer host
* @param {Number} port - Issuer port
* @param {String} clientId - Client ID
*/
module.exports.generateTokenWalletFilename = function (host, port, clientId) {
return (
'token.' +
self.slugify(host + port) +
'.' +
self.slugify(clientId) +
'.json'
)
return `token.${host}${port}.${clientId}.json`
}

module.exports.getToken = function () {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
"snyk": "^1.47.0",
"through": "~2.3.8",
"toobusy-js": "~0.5.1",
"underscore.string": "~3.3.0",
"wildcard": "~1.1.2"
},
"devDependencies": {
Expand Down

0 comments on commit a0d6d46

Please sign in to comment.