Skip to content

Commit

Permalink
chore: Streamline versions of camelcase & decamelize (#374)
Browse files Browse the repository at this point in the history
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
RomainMuller committed Mar 11, 2019
1 parent 5a94825 commit b2e106e
Show file tree
Hide file tree
Showing 36 changed files with 7,313 additions and 20,335 deletions.
560 changes: 280 additions & 280 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions packages/codemaker/lib/case-utils.ts
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);
}
Loading

0 comments on commit b2e106e

Please sign in to comment.