From 77aa1a135695ffa85518afe6436de18792461898 Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Sat, 5 May 2018 19:11:18 -0700 Subject: [PATCH] chore: formatting --- package.json | 4 ++-- src/lib/picker/emoji-search.service.ts | 18 +++++++++++------- src/lib/picker/preview.component.ts | 2 +- src/lib/picker/skins.component.ts | 18 +++++++----------- src/tsconfig.spec.json | 3 +-- 5 files changed, 22 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index acaa5fc4..d6ee3146 100644 --- a/package.json +++ b/package.json @@ -7,9 +7,9 @@ "start": "ng serve", "build": "ts-node build.ts", "build-data": "ts-node scripts/build-data.ts", - "test": "ng test --single-run --browsers=ChromeCI", + "test": "ng test ---watch=false --browsers=ChromeCI", "test:watch": "ng test --browsers=ChromeCI", - "test:ci": "ng test --single-run --code-coverage --no-progress --browsers=ChromeCI", + "test:ci": "ng test --watch=false --code-coverage --no-progress --browsers=ChromeCI", "lint": "ng lint ngx-emoji-mart --type-check --format stylish", "lint:fix": "ng lint ngx-emoji-mart --type-check --fix --format stylish", "ghpages": "ng build --prod --no-progress --baseHref='/ngx-emoji-mart/'", diff --git a/src/lib/picker/emoji-search.service.ts b/src/lib/picker/emoji-search.service.ts index 0bdd9e7a..ea228e3c 100644 --- a/src/lib/picker/emoji-search.service.ts +++ b/src/lib/picker/emoji-search.service.ts @@ -1,15 +1,19 @@ import { Injectable } from '@angular/core'; -import { categories, EmojiData, EmojiService } from '@ctrl/ngx-emoji-mart/ngx-emoji'; +import { + categories, + EmojiData, + EmojiService, +} from '@ctrl/ngx-emoji-mart/ngx-emoji'; import { intersect } from './utils'; @Injectable() export class EmojiSearch { originalPool: any = {}; index: { - results?: EmojiData[], - pool?: { [key: string]: EmojiData }, - [key: string]: any, + results?: EmojiData[]; + pool?: { [key: string]: EmojiData }; + [key: string]: any; } = {}; emojisList: any = {}; emoticonsList: { [key: string]: string } = {}; @@ -83,8 +87,8 @@ export class EmojiSearch { return; } - category.emojis!.forEach(emojiId => - pool[emojiId] = this.emojiService.names[emojiId], + category.emojis!.forEach( + emojiId => (pool[emojiId] = this.emojiService.names[emojiId]), ); }); @@ -114,7 +118,7 @@ export class EmojiSearch { aIndex = aIndex[char]; if (!aIndex.results) { - const scores: {[key: string]: number} = {}; + const scores: { [key: string]: number } = {}; aIndex.results = []; aIndex.pool = {}; diff --git a/src/lib/picker/preview.component.ts b/src/lib/picker/preview.component.ts index ea3accf1..f712ded4 100644 --- a/src/lib/picker/preview.component.ts +++ b/src/lib/picker/preview.component.ts @@ -77,7 +77,7 @@ export class PreviewComponent implements OnChanges { @Input() emojiSheetSize: any; @Input() emojiBackgroundImageFn: any; @Output() skinChange = new EventEmitter(); - emojiData?: EmojiData; + emojiData: Partial = {}; listedEmoticons?: string[]; constructor( diff --git a/src/lib/picker/skins.component.ts b/src/lib/picker/skins.component.ts index 1d6316e8..1bdb6de7 100644 --- a/src/lib/picker/skins.component.ts +++ b/src/lib/picker/skins.component.ts @@ -11,17 +11,13 @@ import { Emoji } from '@ctrl/ngx-emoji-mart/ngx-emoji'; @Component({ selector: 'emoji-skins', template: ` -
-
- - - -
+
+ + +
`, changeDetection: ChangeDetectionStrategy.OnPush, diff --git a/src/tsconfig.spec.json b/src/tsconfig.spec.json index 979cfcfe..fd83c2b9 100644 --- a/src/tsconfig.spec.json +++ b/src/tsconfig.spec.json @@ -11,8 +11,7 @@ "@ctrl/ngx-emoji-mart/ngx-emoji": ["./lib/emoji/public_api"] } }, - "files": ["test.ts" "polyfills.ts" - ,], + "files": ["test.ts", "polyfills.ts"], "include": ["**/*.spec.ts", "**/*.d.ts"], "angularCompilerOptions": { "preserveWhitespaces": false,