Skip to content

Commit

Permalink
code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
santoshyadavdev committed Mar 10, 2019
1 parent 0b4a3a2 commit 4eb91da
Show file tree
Hide file tree
Showing 14 changed files with 63 additions and 77 deletions.
14 changes: 6 additions & 8 deletions modules/effects/schematics-core/utility/ngrx-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,9 @@ export function addReducerToStateInterface(
return new NoopChange();
}

let state = stringUtils.camelize(options.name);
if (options.plural) {
state = stringUtils.camelize(options.name) + 's';
}
const state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);

const keyInsert =
state + ': from' + stringUtils.classify(options.name) + '.State;';
Expand Down Expand Up @@ -154,10 +153,9 @@ export function addReducerToActionReducerMap(

let node = actionReducerMap.initializer;

let state = stringUtils.camelize(options.name);
if (options.plural) {
state = stringUtils.camelize(options.name) + 's';
}
const state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);

const keyInsert =
state + ': from' + stringUtils.classify(options.name) + '.reducer,';
Expand Down
6 changes: 3 additions & 3 deletions modules/effects/schematics-core/utility/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ export function capitalize(str: string): string {
}

/**
Returns the Pluralize form of a string
Returns the plural form of a string
```javascript
'innerHTML'.pluralize() // 'InnerHTMLs'
'action_name'.pluralize() // 'actionNames'
'css-class-name'.pluralize() // 'cssClassNames'
'regex'.capitalize() // 'regexes'
'user'.capitalize() // 'users'
'regex'.pluralize() // 'regexes'
'user'.pluralize() // 'users'
```
*/
export function pluralize(str: string): string {
Expand Down
14 changes: 6 additions & 8 deletions modules/entity/schematics-core/utility/ngrx-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,9 @@ export function addReducerToStateInterface(
return new NoopChange();
}

let state = stringUtils.camelize(options.name);
if (options.plural) {
state = stringUtils.camelize(options.name) + 's';
}
const state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);

const keyInsert =
state + ': from' + stringUtils.classify(options.name) + '.State;';
Expand Down Expand Up @@ -154,10 +153,9 @@ export function addReducerToActionReducerMap(

let node = actionReducerMap.initializer;

let state = stringUtils.camelize(options.name);
if (options.plural) {
state = stringUtils.camelize(options.name) + 's';
}
const state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);

const keyInsert =
state + ': from' + stringUtils.classify(options.name) + '.reducer,';
Expand Down
6 changes: 3 additions & 3 deletions modules/entity/schematics-core/utility/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ export function capitalize(str: string): string {
}

/**
Returns the Pluralize form of a string
Returns the plural form of a string
```javascript
'innerHTML'.pluralize() // 'InnerHTMLs'
'action_name'.pluralize() // 'actionNames'
'css-class-name'.pluralize() // 'cssClassNames'
'regex'.capitalize() // 'regexes'
'user'.capitalize() // 'users'
'regex'.pluralize() // 'regexes'
'user'.pluralize() // 'users'
```
*/
export function pluralize(str: string): string {
Expand Down
14 changes: 6 additions & 8 deletions modules/router-store/schematics-core/utility/ngrx-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,9 @@ export function addReducerToStateInterface(
return new NoopChange();
}

let state = stringUtils.camelize(options.name);
if (options.plural) {
state = stringUtils.camelize(options.name) + 's';
}
const state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);

const keyInsert =
state + ': from' + stringUtils.classify(options.name) + '.State;';
Expand Down Expand Up @@ -154,10 +153,9 @@ export function addReducerToActionReducerMap(

let node = actionReducerMap.initializer;

let state = stringUtils.camelize(options.name);
if (options.plural) {
state = stringUtils.camelize(options.name) + 's';
}
const state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);

const keyInsert =
state + ': from' + stringUtils.classify(options.name) + '.reducer,';
Expand Down
6 changes: 3 additions & 3 deletions modules/router-store/schematics-core/utility/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ export function capitalize(str: string): string {
}

/**
Returns the Pluralize form of a string
Returns the plural form of a string
```javascript
'innerHTML'.pluralize() // 'InnerHTMLs'
'action_name'.pluralize() // 'actionNames'
'css-class-name'.pluralize() // 'cssClassNames'
'regex'.capitalize() // 'regexes'
'user'.capitalize() // 'users'
'regex'.pluralize() // 'regexes'
'user'.pluralize() // 'users'
```
*/
export function pluralize(str: string): string {
Expand Down
14 changes: 6 additions & 8 deletions modules/schematics-core/utility/ngrx-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,9 @@ export function addReducerToStateInterface(
return new NoopChange();
}

let state = stringUtils.camelize(options.name);
if (options.plural) {
state = stringUtils.camelize(options.name) + 's';
}
const state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);

const keyInsert =
state + ': from' + stringUtils.classify(options.name) + '.State;';
Expand Down Expand Up @@ -154,10 +153,9 @@ export function addReducerToActionReducerMap(

let node = actionReducerMap.initializer;

let state = stringUtils.camelize(options.name);
if (options.plural) {
state = stringUtils.camelize(options.name) + 's';
}
const state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);

const keyInsert =
state + ': from' + stringUtils.classify(options.name) + '.reducer,';
Expand Down
6 changes: 3 additions & 3 deletions modules/schematics-core/utility/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ export function capitalize(str: string): string {
}

/**
Returns the Pluralize form of a string
Returns the plural form of a string
```javascript
'innerHTML'.pluralize() // 'InnerHTMLs'
'action_name'.pluralize() // 'actionNames'
'css-class-name'.pluralize() // 'cssClassNames'
'regex'.capitalize() // 'regexes'
'user'.capitalize() // 'users'
'regex'.pluralize() // 'regexes'
'user'.pluralize() // 'users'
```
*/
export function pluralize(str: string): string {
Expand Down
14 changes: 6 additions & 8 deletions modules/schematics/schematics-core/utility/ngrx-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,9 @@ export function addReducerToStateInterface(
return new NoopChange();
}

let state = stringUtils.camelize(options.name);
if (options.plural) {
state = stringUtils.camelize(options.name) + 's';
}
const state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);

const keyInsert =
state + ': from' + stringUtils.classify(options.name) + '.State;';
Expand Down Expand Up @@ -154,10 +153,9 @@ export function addReducerToActionReducerMap(

let node = actionReducerMap.initializer;

let state = stringUtils.camelize(options.name);
if (options.plural) {
state = stringUtils.camelize(options.name) + 's';
}
const state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);

const keyInsert =
state + ': from' + stringUtils.classify(options.name) + '.reducer,';
Expand Down
6 changes: 3 additions & 3 deletions modules/schematics/schematics-core/utility/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ export function capitalize(str: string): string {
}

/**
Returns the Pluralize form of a string
Returns the plural form of a string
```javascript
'innerHTML'.pluralize() // 'InnerHTMLs'
'action_name'.pluralize() // 'actionNames'
'css-class-name'.pluralize() // 'cssClassNames'
'regex'.capitalize() // 'regexes'
'user'.capitalize() // 'users'
'regex'.pluralize() // 'regexes'
'user'.pluralize() // 'users'
```
*/
export function pluralize(str: string): string {
Expand Down
14 changes: 6 additions & 8 deletions modules/store-devtools/schematics-core/utility/ngrx-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,9 @@ export function addReducerToStateInterface(
return new NoopChange();
}

let state = stringUtils.camelize(options.name);
if (options.plural) {
state = stringUtils.camelize(options.name) + 's';
}
const state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);

const keyInsert =
state + ': from' + stringUtils.classify(options.name) + '.State;';
Expand Down Expand Up @@ -154,10 +153,9 @@ export function addReducerToActionReducerMap(

let node = actionReducerMap.initializer;

let state = stringUtils.camelize(options.name);
if (options.plural) {
state = stringUtils.camelize(options.name) + 's';
}
const state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);

const keyInsert =
state + ': from' + stringUtils.classify(options.name) + '.reducer,';
Expand Down
6 changes: 3 additions & 3 deletions modules/store-devtools/schematics-core/utility/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ export function capitalize(str: string): string {
}

/**
Returns the Pluralize form of a string
Returns the plural form of a string
```javascript
'innerHTML'.pluralize() // 'InnerHTMLs'
'action_name'.pluralize() // 'actionNames'
'css-class-name'.pluralize() // 'cssClassNames'
'regex'.capitalize() // 'regexes'
'user'.capitalize() // 'users'
'regex'.pluralize() // 'regexes'
'user'.pluralize() // 'users'
```
*/
export function pluralize(str: string): string {
Expand Down
14 changes: 6 additions & 8 deletions modules/store/schematics-core/utility/ngrx-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,9 @@ export function addReducerToStateInterface(
return new NoopChange();
}

let state = stringUtils.camelize(options.name);
if (options.plural) {
state = stringUtils.camelize(options.name) + 's';
}
const state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);

const keyInsert =
state + ': from' + stringUtils.classify(options.name) + '.State;';
Expand Down Expand Up @@ -154,10 +153,9 @@ export function addReducerToActionReducerMap(

let node = actionReducerMap.initializer;

let state = stringUtils.camelize(options.name);
if (options.plural) {
state = stringUtils.camelize(options.name) + 's';
}
const state = options.plural
? stringUtils.pluralize(options.name)
: stringUtils.camelize(options.name);

const keyInsert =
state + ': from' + stringUtils.classify(options.name) + '.reducer,';
Expand Down
6 changes: 3 additions & 3 deletions modules/store/schematics-core/utility/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ export function capitalize(str: string): string {
}

/**
Returns the Pluralize form of a string
Returns the plural form of a string
```javascript
'innerHTML'.pluralize() // 'InnerHTMLs'
'action_name'.pluralize() // 'actionNames'
'css-class-name'.pluralize() // 'cssClassNames'
'regex'.capitalize() // 'regexes'
'user'.capitalize() // 'users'
'regex'.pluralize() // 'regexes'
'user'.pluralize() // 'users'
```
*/
export function pluralize(str: string): string {
Expand Down

0 comments on commit 4eb91da

Please sign in to comment.