refactor: simplify arrow functions (#12057)

This commit is contained in:
Victor Berchet
2016-10-04 15:57:37 -07:00
committed by Chuck Jazdzewski
parent 6f7ed32154
commit 0528dcb9dc
25 changed files with 43 additions and 51 deletions

View File

@ -24,7 +24,7 @@ export class BrowserGetTestability implements GetTestability {
return testability;
};
global.getAllAngularTestabilities = () => { return registry.getAllTestabilities(); };
global.getAllAngularTestabilities = () => registry.getAllTestabilities();
global.getAllAngularRootElements = () => registry.getAllRootElements();

View File

@ -52,6 +52,6 @@ export class By {
* {@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'}
*/
static directive(type: Type<any>): Predicate<DebugElement> {
return (debugElement) => { return debugElement.providerTokens.indexOf(type) !== -1; };
return (debugElement) => debugElement.providerTokens.indexOf(type) !== -1;
}
}

View File

@ -14,10 +14,10 @@ var DASH_CASE_REGEXP = /-([a-z])/g;
export function camelCaseToDashCase(input: string): string {
return StringWrapper.replaceAllMapped(
input, CAMEL_CASE_REGEXP, (m: any /** TODO #9100 */) => { return '-' + m[1].toLowerCase(); });
input, CAMEL_CASE_REGEXP, (m: string[]) => '-' + m[1].toLowerCase());
}
export function dashCaseToCamelCase(input: string): string {
return StringWrapper.replaceAllMapped(
input, DASH_CASE_REGEXP, (m: any /** TODO #9100 */) => { return m[1].toUpperCase(); });
input, DASH_CASE_REGEXP, (m: string[]) => m[1].toUpperCase());
}