Browse Source

feat: add clearly named text utils

pull/5137/head
Arman Ozak 6 years ago
parent
commit
f6e1c4fd28
  1. 1
      npm/ng-packs/packages/schematics/src/utils/index.ts
  2. 9
      npm/ng-packs/packages/schematics/src/utils/text.ts

1
npm/ng-packs/packages/schematics/src/utils/index.ts

@ -1 +1,2 @@
export * from './angular'; export * from './angular';
export * from './text';

9
npm/ng-packs/packages/schematics/src/utils/text.ts

@ -0,0 +1,9 @@
import { strings } from '@angular-devkit/core';
export const camel = strings.camelize;
export const kebab = strings.dasherize;
export const lower = (text: string) => text.toLowerCase();
export const macro = (text: string) => strings.underscore(text).toUpperCase();
export const pascal = strings.classify;
export const snake = strings.underscore;
export const upper = (text: string) => text.toUpperCase();
Loading…
Cancel
Save