From c8baf51f4fb7760f4faaae5d40ec28ed715c22a3 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Fri, 9 Dec 2016 11:19:55 -0800 Subject: [PATCH] style: clang-format the code --- .../@angular/compiler/src/i18n/extractor_merger.ts | 9 +++++---- modules/@angular/examples/README.md | 2 +- .../@angular/language-service/test/ts_plugin_spec.ts | 3 ++- modules/@angular/router/src/create_url_tree.ts | 12 ++++++------ modules/@angular/router/src/url_tree.ts | 2 +- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/modules/@angular/compiler/src/i18n/extractor_merger.ts b/modules/@angular/compiler/src/i18n/extractor_merger.ts index 97015e8d8b..b4a81016b7 100644 --- a/modules/@angular/compiler/src/i18n/extractor_merger.ts +++ b/modules/@angular/compiler/src/i18n/extractor_merger.ts @@ -503,10 +503,11 @@ function _parseMessageMeta(i18n: string): {meaning: string, description: string, const idIndex = i18n.indexOf(ID_SEPARATOR); const descIndex = i18n.indexOf(MEANING_SEPARATOR); - const [meaningAndDesc, id] = (idIndex > -1) ? [i18n.slice(0, idIndex), i18n.slice(idIndex + 2)] : - [i18n, '']; - const [meaning, description] = (descIndex > -1) ? [meaningAndDesc.slice(0, descIndex), meaningAndDesc.slice(descIndex + 1)] : - ['', meaningAndDesc]; + const [meaningAndDesc, id] = + (idIndex > -1) ? [i18n.slice(0, idIndex), i18n.slice(idIndex + 2)] : [i18n, '']; + const [meaning, description] = (descIndex > -1) ? + [meaningAndDesc.slice(0, descIndex), meaningAndDesc.slice(descIndex + 1)] : + ['', meaningAndDesc]; return {meaning, description, id}; } diff --git a/modules/@angular/examples/README.md b/modules/@angular/examples/README.md index f287ffaae1..811366fd6c 100644 --- a/modules/@angular/examples/README.md +++ b/modules/@angular/examples/README.md @@ -29,6 +29,6 @@ navigate to [http://localhost:8001](http://localhost:8001) ./modules/@angular/examples/test.sh ``` -NOTE: sometimes the http server does not exits properly and it retans the `8001` port. +NOTE: sometimes the http server does not exit properly and it retains the `8001` port. in such a case you can use `lsof -i:8001` to see which process it is and then use `kill` to remove it. (Or in single command: `lsof -i:8001 -t | xargs kill`) \ No newline at end of file diff --git a/modules/@angular/language-service/test/ts_plugin_spec.ts b/modules/@angular/language-service/test/ts_plugin_spec.ts index 7dabc12168..5c15f9c616 100644 --- a/modules/@angular/language-service/test/ts_plugin_spec.ts +++ b/modules/@angular/language-service/test/ts_plugin_spec.ts @@ -186,7 +186,8 @@ describe('plugin', () => { expectSemanticError('app/ng-if-cases.ts', locationMarker, message); } it('should report an implicit context reference', () => { - expectError('implicit', "The template context does not defined a member called 'unknown'"); + expectError( + 'implicit', 'The template context does not defined a member called \'unknown\''); }); }); }); diff --git a/modules/@angular/router/src/create_url_tree.ts b/modules/@angular/router/src/create_url_tree.ts index 3c7dda40b3..ed873bbbef 100644 --- a/modules/@angular/router/src/create_url_tree.ts +++ b/modules/@angular/router/src/create_url_tree.ts @@ -9,7 +9,7 @@ import {ActivatedRoute} from './router_state'; import {PRIMARY_OUTLET, Params} from './shared'; import {UrlSegment, UrlSegmentGroup, UrlTree} from './url_tree'; -import {forEach, shallowEqual, last} from './utils/collection'; +import {forEach, last, shallowEqual} from './utils/collection'; export function createUrlTree( route: ActivatedRoute, urlTree: UrlTree, commands: any[], queryParams: Params, @@ -29,8 +29,7 @@ export function createUrlTree( const segmentGroup = startingPosition.processChildren ? updateSegmentGroupChildren( startingPosition.segmentGroup, startingPosition.index, nav.commands) : - updateSegmentGroup( - startingPosition.segmentGroup, startingPosition.index, nav.commands); + updateSegmentGroup(startingPosition.segmentGroup, startingPosition.index, nav.commands); return tree(startingPosition.segmentGroup, segmentGroup, urlTree, queryParams, fragment); } @@ -65,7 +64,8 @@ function replaceSegment( } class Navigation { - constructor(public isAbsolute: boolean, public numberOfDoubleDots: number, public commands: any[]) { + constructor( + public isAbsolute: boolean, public numberOfDoubleDots: number, public commands: any[]) { if (isAbsolute && commands.length > 0 && isMatrixParams(commands[0])) { throw new Error('Root segment cannot have matrix parameters'); } @@ -148,8 +148,8 @@ function findStartingPosition(nav: Navigation, tree: UrlTree, route: ActivatedRo const modifier = isMatrixParams(nav.commands[0]) ? 0 : 1; const index = route.snapshot._lastPathIndex + modifier; - return createPositionApplyingDoubleDots(route.snapshot._urlSegment, index, nav.numberOfDoubleDots); - + return createPositionApplyingDoubleDots( + route.snapshot._urlSegment, index, nav.numberOfDoubleDots); } function createPositionApplyingDoubleDots( diff --git a/modules/@angular/router/src/url_tree.ts b/modules/@angular/router/src/url_tree.ts index 1adae222a9..7888435716 100644 --- a/modules/@angular/router/src/url_tree.ts +++ b/modules/@angular/router/src/url_tree.ts @@ -20,7 +20,7 @@ export function containsTree(container: UrlTree, containee: UrlTree, exact: bool } return containsQueryParams(container.queryParams, containee.queryParams) && - containsSegmentGroup(container.root, containee.root); + containsSegmentGroup(container.root, containee.root); } function equalQueryParams(