Skip to content

Commit

Permalink
chore: update dependencies (#1284)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: see [yargs-parser@12.0.0 CHANGELOG](https://github.com/yargs/yargs-parser/blob/master/CHANGELOG.md#breaking-changes)
  • Loading branch information
bcoe committed Feb 2, 2019
1 parent 6916ce9 commit f25de4f
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 21 deletions.
32 changes: 32 additions & 0 deletions lib/decamelize.js
@@ -0,0 +1,32 @@
/*
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (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()
}
21 changes: 16 additions & 5 deletions lib/levenshtein.js
@@ -1,11 +1,22 @@
/*
Copyright (c) 2011 Andrei Mackenzie
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.
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.
*/

// levenshtein distance algorithm, pulled from Andrei Mackenzie's MIT licensed.
Expand Down
3 changes: 2 additions & 1 deletion lib/usage.js
@@ -1,6 +1,7 @@
'use strict'
// this file handles outputting usage instructions,
// failures, etc. keeps logging in one place.
const decamelize = require('./decamelize')
const stringWidth = require('string-width')
const objFilter = require('./obj-filter')
const path = require('path')
Expand Down Expand Up @@ -432,7 +433,7 @@ module.exports = function usage (yargs, y18n) {
}

self.functionDescription = (fn) => {
const description = fn.name ? require('decamelize')(fn.name, '-') : __('generated-value')
const description = fn.name ? decamelize(fn.name, '-') : __('generated-value')
return ['(', description, ')'].join('')
}

Expand Down
29 changes: 14 additions & 15 deletions package.json
Expand Up @@ -19,32 +19,31 @@
],
"dependencies": {
"cliui": "^4.0.0",
"decamelize": "^1.2.0",
"find-up": "^3.0.0",
"get-caller-file": "^1.0.1",
"get-caller-file": "^2.0.1",
"os-locale": "^3.1.0",
"require-directory": "^2.1.1",
"require-main-filename": "^1.0.1",
"require-main-filename": "^2.0.0",
"set-blocking": "^2.0.0",
"string-width": "^2.0.0",
"string-width": "^3.0.0",
"which-module": "^2.0.0",
"y18n": "^3.2.1 || ^4.0.0",
"yargs-parser": "^11.1.1"
"y18n": "^4.0.0",
"yargs-parser": "^12.0.0"
},
"devDependencies": {
"chai": "^4.1.2",
"chalk": "^1.1.3",
"chai": "^4.2.0",
"chalk": "^2.4.2",
"coveralls": "^3.0.2",
"cpr": "^2.0.0",
"cpr": "^3.0.1",
"cross-spawn": "^6.0.4",
"es6-promise": "^4.0.2",
"es6-promise": "^4.2.5",
"hashish": "0.0.4",
"mocha": "^5.1.1",
"nyc": "^11.7.3",
"rimraf": "^2.5.0",
"mocha": "^5.2.0",
"nyc": "^13.2.0",
"rimraf": "^2.6.3",
"standard": "^11.0.1",
"standard-version": "^4.2.0",
"which": "^1.2.9",
"standard-version": "^4.4.0",
"which": "^1.3.1",
"yargs-test-extends": "^1.0.1"
},
"scripts": {
Expand Down

0 comments on commit f25de4f

Please sign in to comment.