Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b2e106e

Browse files
authoredMar 11, 2019
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.
1 parent 5a94825 commit b2e106e

File tree

36 files changed

+7313
-20335
lines changed

36 files changed

+7313
-20335
lines changed
 

‎package-lock.json

Lines changed: 280 additions & 280 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/codemaker/lib/case-utils.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
import * as camelcase from 'camelcase'
2-
import * as decamelize from 'decamelize'
1+
import { default as camelcase } from 'camelcase';
2+
import * as decamelize from 'decamelize';
33

44
export function toCamelCase(...args: string[]) {
5-
return camelcase(...args);
5+
return camelcase(args);
66
}
77

88
export function toPascalCase(...args: string[]) {
9-
const v = toCamelCase(...args);
10-
return v.charAt(0).toUpperCase() + v.slice(1);
9+
return camelcase(args, { pascalCase: true });
1110
}
1211

1312
export function toSnakeCase(s: string, sep = '_') {
14-
return decamelize(s, sep)
13+
return decamelize(s, sep);
1514
}

0 commit comments

Comments
 (0)
Please sign in to comment.