diff --git a/lib/decamelize.js b/lib/decamelize.js deleted file mode 100644 index c3a415151..000000000 --- a/lib/decamelize.js +++ /dev/null @@ -1,32 +0,0 @@ -/* -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ -'use strict' - -module.exports = (text, separator) => { - separator = typeof separator === 'undefined' ? '_' : separator - - return text - .replace(/([a-z\d])([A-Z])/g, `$1${separator}$2`) - .replace(/([A-Z]+)([A-Z][a-z\d]+)/g, `$1${separator}$2`) - .toLowerCase() -} diff --git a/lib/usage.js b/lib/usage.js index 8c3b068f8..cbcb1764e 100644 --- a/lib/usage.js +++ b/lib/usage.js @@ -1,7 +1,7 @@ 'use strict' // this file handles outputting usage instructions, // failures, etc. keeps logging in one place. -const decamelize = require('./decamelize') +const decamelize = require('decamelize') const stringWidth = require('string-width') const objFilter = require('./obj-filter') const path = require('path') diff --git a/package.json b/package.json index 436c04ba4..f8f06cf0a 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ ], "dependencies": { "cliui": "^5.0.0", + "decamelize": "^1.2.0", "find-up": "^3.0.0", "get-caller-file": "^2.0.1", "require-directory": "^2.1.1",