Browse Source

rollback string replace

- move condition from ternary op to if
pull/12330/head
muhammedaltug 5 years ago
parent
commit
7dd744137c
  1. 9
      npm/ng-packs/packages/schematics/src/models/method.ts
  2. 2
      npm/ng-packs/packages/schematics/src/utils/service.ts

9
npm/ng-packs/packages/schematics/src/models/method.ts

@ -47,11 +47,12 @@ export class Body {
const { bindingSourceId, descriptorName, jsonName, name, nameOnMethod } = param; const { bindingSourceId, descriptorName, jsonName, name, nameOnMethod } = param;
const camelName = camel(name); const camelName = camel(name);
const paramName = jsonName || camelName; const paramName = jsonName || camelName;
const value = descriptorName let value = camelizeHyphen(nameOnMethod);
? shouldQuote(paramName) if (descriptorName) {
value = shouldQuote(paramName)
? `${descriptorName}['${paramName}']` ? `${descriptorName}['${paramName}']`
: `${descriptorName}.${paramName}` : `${descriptorName}.${paramName}`;
: camelizeHyphen(nameOnMethod); }
switch (bindingSourceId) { switch (bindingSourceId) {
case eBindingSourceId.Model: case eBindingSourceId.Model:

2
npm/ng-packs/packages/schematics/src/utils/service.ts

@ -99,7 +99,7 @@ export function createActionToSignatureMapper() {
} }
function getMethodNameFromAction(action: Action): string { function getMethodNameFromAction(action: Action): string {
return action.uniqueName.replace('Async', ''); return action.uniqueName.split('Async')[0];
} }
function getVersionParameter(action: Action) { function getVersionParameter(action: Action) {

Loading…
Cancel
Save