-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Streamline versions of camelcase & decamelize (#374)
Use the same versions that `yargs` uses in order to avoid having to hoist multiple distinct versions in the overall dependency closure. This also can cause issues in contexts where Node's multiple-version handling is not available.
- Loading branch information
1 parent
5a94825
commit b2e106e
Showing
36 changed files
with
7,313 additions
and
20,335 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
import * as camelcase from 'camelcase' | ||
import * as decamelize from 'decamelize' | ||
import { default as camelcase } from 'camelcase'; | ||
import * as decamelize from 'decamelize'; | ||
|
||
export function toCamelCase(...args: string[]) { | ||
return camelcase(...args); | ||
return camelcase(args); | ||
} | ||
|
||
export function toPascalCase(...args: string[]) { | ||
const v = toCamelCase(...args); | ||
return v.charAt(0).toUpperCase() + v.slice(1); | ||
return camelcase(args, { pascalCase: true }); | ||
} | ||
|
||
export function toSnakeCase(s: string, sep = '_') { | ||
return decamelize(s, sep) | ||
return decamelize(s, sep); | ||
} |
Oops, something went wrong.