From 4f1a52a1b0ef5bc4707c2bc1b700f084102dca99 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sat, 15 Apr 2017 19:04:49 +0200 Subject: [PATCH] Corrected some linting errors. --- e2e/app.e2e-spec.ts | 2 +- e2e/app.po.ts | 14 +++--- src/app/app-routing.module.ts | 4 +- src/app/app.component.spec.ts | 8 ++-- src/app/app.component.ts | 27 ++++++------ src/app/app.module.ts | 12 +++--- src/app/converter/base64decoder.ts | 8 ++-- src/app/converter/base64encoder.ts | 8 ++-- src/app/converter/bintodecconverter.ts | 8 ++-- src/app/converter/dectobinconverter.ts | 8 ++-- src/app/converter/dectohexconverter.ts | 8 ++-- src/app/converter/hextodecconverter.ts | 8 ++-- src/app/converter/htmlentitiesdecoder.ts | 14 +++--- src/app/converter/htmlentitiesencoder.ts | 14 +++--- src/app/converter/punycodedecoder.ts | 8 ++-- src/app/converter/punycodeencoder.ts | 8 ++-- src/app/converter/quotedprintabledecoder.ts | 10 ++--- src/app/converter/quotedprintableencoder.ts | 8 ++-- src/app/converter/uricomponentdecoder.ts | 6 +-- src/app/converter/uricomponentencoder.ts | 6 +-- src/app/converter/uridecoder.ts | 6 +-- src/app/converter/uriencoder.ts | 6 +-- src/app/converter/utf8decoder.ts | 10 ++--- src/app/converter/utf8encoder.ts | 10 ++--- src/app/converterregistry.service.ts | 48 ++++++++++----------- src/app/inputcomponentmanager.service.ts | 10 ++--- src/app/nativelibrarywrapper.service.ts | 14 +++--- src/app/step.ts | 8 ++-- src/main.ts | 8 ++-- src/polyfills.ts | 32 +++++++------- src/test.ts | 16 +++---- 31 files changed, 179 insertions(+), 178 deletions(-) diff --git a/e2e/app.e2e-spec.ts b/e2e/app.e2e-spec.ts index 924c313..eec75ee 100644 --- a/e2e/app.e2e-spec.ts +++ b/e2e/app.e2e-spec.ts @@ -1,4 +1,4 @@ -import {ConvertorizrPage} from "./app.po"; +import {ConvertorizrPage} from './app.po'; describe('convertorizr App', () => { let page: ConvertorizrPage; diff --git a/e2e/app.po.ts b/e2e/app.po.ts index f1eea5b..89c646b 100644 --- a/e2e/app.po.ts +++ b/e2e/app.po.ts @@ -1,4 +1,4 @@ -import {browser, by, element} from "protractor"; +import {browser, by, element} from 'protractor'; export class ConvertorizrPage { navigateTo() { @@ -6,19 +6,19 @@ export class ConvertorizrPage { } public foo() { - return "bar"; + return 'bar'; } public getInputfieldContent(index: number): Promise { - let css1 = by.css('app-root div.inputwrapper'); + const css1 = by.css('app-root div.inputwrapper'); console.log(css1); - let el1 = element.all(css1)[index]; + const el1 = element.all(css1)[index]; console.log(el1); - let css2 = by.css('.textwrapper textarea'); + const css2 = by.css('.textwrapper textarea'); console.log(css2); - let el2 = el1.findElement(css2); + const el2 = el1.findElement(css2); console.log(el2); - let t = el2.getText(); + const t = el2.getText(); console.log(t); return t; } diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 2289c42..66ce429 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,5 +1,5 @@ -import {NgModule} from "@angular/core"; -import {RouterModule, Routes} from "@angular/router"; +import {NgModule} from '@angular/core'; +import {RouterModule, Routes} from '@angular/router'; const routes: Routes = [ { diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 89f7c8e..0340bf1 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -1,7 +1,7 @@ -import {AppComponent} from "./app.component"; -import {async, ComponentFixture, TestBed} from "@angular/core/testing"; -import {InputComponentManagerService} from "./inputcomponentmanager.service"; -import {Step} from "./step"; +import {AppComponent} from './app.component'; +import {async, ComponentFixture, TestBed} from '@angular/core/testing'; +import {InputComponentManagerService} from './inputcomponentmanager.service'; +import {Step} from './step'; describe('AppComponent', () => { let sut: AppComponent; diff --git a/src/app/app.component.ts b/src/app/app.component.ts index e5b9bbc..f0b4034 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,9 +1,9 @@ -import {Component, OnInit} from "@angular/core"; -import {ConverterRegistryService} from "./converterregistry.service"; -import {InputComponentManagerService} from "./inputcomponentmanager.service"; -import {NativeLibraryWrapperService} from "./nativelibrarywrapper.service"; -import {Step} from "./step"; -import {Converter} from "./converter/converter"; +import {Component, OnInit} from '@angular/core'; +import {ConverterRegistryService} from './converterregistry.service'; +import {InputComponentManagerService} from './inputcomponentmanager.service'; +import {NativeLibraryWrapperService} from './nativelibrarywrapper.service'; +import {Step} from './step'; +import {Converter} from './converter/converter'; @Component({ selector: 'app-root', @@ -15,7 +15,8 @@ export class AppComponent implements OnInit { public steps: Step[] = []; public converters: Converter[] = []; - constructor(private converterRegistryService: ConverterRegistryService, private inputComponentManagerService: InputComponentManagerService) { + constructor(private converterRegistryService: ConverterRegistryService, + private inputComponentManagerService: InputComponentManagerService) { } convert(step: Step, $event: any): void { @@ -24,15 +25,15 @@ export class AppComponent implements OnInit { } update(step: Step): void { - let converter: Converter = step.selectedConverter; + const converter: Converter = step.selectedConverter; if (converter !== undefined) { - let content: string = step.content; + const content: string = step.content; let result: string; try { result = converter.convert(content); } catch (error) { - if (typeof console === "object" && typeof console.log === "function") { + if (typeof console === 'object' && typeof console.log === 'function') { console.log(error); } step.message = error.message; @@ -40,10 +41,10 @@ export class AppComponent implements OnInit { result = null; } if (result !== null) { - step.message = ""; + step.message = ''; step.error = false; - if (result !== "") { - let nextComponent: Step = this.inputComponentManagerService.getNext(step); + if (result !== '') { + const nextComponent: Step = this.inputComponentManagerService.getNext(step); nextComponent.content = result; this.update(nextComponent); } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 1553ed1..09fae0b 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,10 +1,10 @@ -import {BrowserModule} from "@angular/platform-browser"; -import {NgModule} from "@angular/core"; -import {FormsModule} from "@angular/forms"; -import {HttpModule} from "@angular/http"; +import {BrowserModule} from '@angular/platform-browser'; +import {NgModule} from '@angular/core'; +import {FormsModule} from '@angular/forms'; +import {HttpModule} from '@angular/http'; -import {AppRoutingModule} from "./app-routing.module"; -import {AppComponent} from "./app.component"; +import {AppRoutingModule} from './app-routing.module'; +import {AppComponent} from './app.component'; @NgModule({ declarations: [ diff --git a/src/app/converter/base64decoder.ts b/src/app/converter/base64decoder.ts index 2f9c630..6856c2b 100644 --- a/src/app/converter/base64decoder.ts +++ b/src/app/converter/base64decoder.ts @@ -1,19 +1,19 @@ -import {Converter} from "./converter"; +import {Converter} from './converter'; export class Base64Decoder implements Converter { getDisplayname(): string { - return "Decode Base 64"; + return 'Decode Base 64'; } getId(): string { - return "base64decode"; + return 'base64decode'; } convert(input: string): string { try { return atob(input); } catch (exception) { - throw new Error("Could not decode base64 string. Maybe corrupt input?"); + throw new Error('Could not decode base64 string. Maybe corrupt input?'); } } } diff --git a/src/app/converter/base64encoder.ts b/src/app/converter/base64encoder.ts index 86fe1f6..49fa251 100644 --- a/src/app/converter/base64encoder.ts +++ b/src/app/converter/base64encoder.ts @@ -1,12 +1,12 @@ -import {Converter} from "./converter"; +import {Converter} from './converter'; export class Base64Encoder implements Converter { getDisplayname(): string { - return "Encode Base 64"; + return 'Encode Base 64'; } getId(): string { - return "base64encode"; + return 'base64encode'; } convert(input: string): string { @@ -14,7 +14,7 @@ export class Base64Encoder implements Converter { return btoa(input); } catch (exception) { console.error(exception); - throw new Error("Ouch! Looks like you've got a UTF-8 character there. Too bad, this is not supported yet. We're working on it and hope to be ready soon! Why don't you enjoy some kittens meanwhile?"); + throw new Error('Ouch! Looks like you've got a UTF-8 character there. Too bad, this is not supported yet. We're working on it and hope to be ready soon! Why don't you enjoy some kittens meanwhile?'); } } } diff --git a/src/app/converter/bintodecconverter.ts b/src/app/converter/bintodecconverter.ts index 8042f13..9eeb46d 100644 --- a/src/app/converter/bintodecconverter.ts +++ b/src/app/converter/bintodecconverter.ts @@ -1,18 +1,18 @@ -import {Converter} from "./converter"; +import {Converter} from './converter'; export class BinToDecConverter implements Converter { getDisplayname(): string { - return "Convert binary to decimal"; + return 'Convert binary to decimal'; } getId(): string { - return "bintodec"; + return 'bintodec'; } convert(input: string): string { let n: number = parseInt(input, 2); if (isNaN(n)) { - throw new Error("The input seems not to be a valid binary number."); + throw new Error('The input seems not to be a valid binary number.'); } return n.toString(10); } diff --git a/src/app/converter/dectobinconverter.ts b/src/app/converter/dectobinconverter.ts index a1689f7..7870238 100644 --- a/src/app/converter/dectobinconverter.ts +++ b/src/app/converter/dectobinconverter.ts @@ -1,18 +1,18 @@ -import {Converter} from "./converter"; +import {Converter} from './converter'; export class DecToBinConverter implements Converter { getDisplayname(): string { - return "Convert decimal to binary"; + return 'Convert decimal to binary'; } getId(): string { - return "dectobin"; + return 'dectobin'; } convert(input: string): string { let n: number = parseInt(input, 10); if (isNaN(n)) { - throw new Error("The input seems not to be a valid integer."); + throw new Error('The input seems not to be a valid integer.'); } return n.toString(2); } diff --git a/src/app/converter/dectohexconverter.ts b/src/app/converter/dectohexconverter.ts index 17781c3..ab29df2 100644 --- a/src/app/converter/dectohexconverter.ts +++ b/src/app/converter/dectohexconverter.ts @@ -1,18 +1,18 @@ -import {Converter} from "./converter"; +import {Converter} from './converter'; export class DecToHexConverter implements Converter { getDisplayname(): string { - return "Convert decimal to hexadecimal"; + return 'Convert decimal to hexadecimal'; } getId(): string { - return "dectohex"; + return 'dectohex'; } convert(input: string): string { let n: number = parseInt(input, 10); if (isNaN(n)) { - throw new Error("The input seems not to be a valid integer."); + throw new Error('The input seems not to be a valid integer.'); } return n.toString(16); } diff --git a/src/app/converter/hextodecconverter.ts b/src/app/converter/hextodecconverter.ts index c9eb07d..406bd04 100644 --- a/src/app/converter/hextodecconverter.ts +++ b/src/app/converter/hextodecconverter.ts @@ -1,18 +1,18 @@ -import {Converter} from "./converter"; +import {Converter} from './converter'; export class HexToDecConverter implements Converter { getDisplayname(): string { - return "Convert hexadecimal to decimal"; + return 'Convert hexadecimal to decimal'; } getId(): string { - return "hextodec"; + return 'hextodec'; } convert(input: string): string { let n: number = parseInt(input, 16); if (isNaN(n)) { - throw new Error("The input seems not to be a valid hexadecimal number.") + throw new Error('The input seems not to be a valid hexadecimal number.') } return n.toString(10); } diff --git a/src/app/converter/htmlentitiesdecoder.ts b/src/app/converter/htmlentitiesdecoder.ts index 7671f94..da2943a 100644 --- a/src/app/converter/htmlentitiesdecoder.ts +++ b/src/app/converter/htmlentitiesdecoder.ts @@ -1,19 +1,19 @@ -import {Converter} from "./converter"; +import {Converter} from './converter'; export class HTMLEntitiesDecoder implements Converter { getDisplayname(): string { - return "Decode HTML entities"; + return 'Decode HTML entities'; } getId(): string { - return "decodehtmlentities"; + return 'decodehtmlentities'; } convert(input: string): string { return input - .replace(/\"\;/g, "\"") - .replace(/\>\;/g, ">") - .replace(/\<\;/g, "<") - .replace(/\&\;/g, "&"); + .replace(/\"\;/g, '\'') + .replace(/\>\;/g, '>') + .replace(/\<\;/g, '<') + .replace(/\&\;/g, '&'); } } diff --git a/src/app/converter/htmlentitiesencoder.ts b/src/app/converter/htmlentitiesencoder.ts index 69234c5..994ccd0 100644 --- a/src/app/converter/htmlentitiesencoder.ts +++ b/src/app/converter/htmlentitiesencoder.ts @@ -1,19 +1,19 @@ -import {Converter} from "./converter"; +import {Converter} from './converter'; export class HTMLEntitiesEncoder implements Converter { getDisplayname(): string { - return "Encode HTML entities"; + return 'Encode HTML entities'; } getId(): string { - return "encodehtmlentities"; + return 'encodehtmlentities'; } convert(input: string): string { return input - .replace(/\&/g, "&") - .replace(/\/g, ">") - .replace(/\"/g, """); + .replace(/\&/g, '&') + .replace(/\/g, '>') + .replace(/\'/g, '"'); } } diff --git a/src/app/converter/punycodedecoder.ts b/src/app/converter/punycodedecoder.ts index cd111a4..5f68ec6 100644 --- a/src/app/converter/punycodedecoder.ts +++ b/src/app/converter/punycodedecoder.ts @@ -1,5 +1,5 @@ -import {Converter} from "./converter"; -import {NativeLibraryWrapperService} from "../nativelibrarywrapper.service"; +import {Converter} from './converter'; +import {NativeLibraryWrapperService} from '../nativelibrarywrapper.service'; export class PunycodeDecoder implements Converter { @@ -7,11 +7,11 @@ export class PunycodeDecoder implements Converter { } getDisplayname(): string { - return "Decode from punycode"; + return 'Decode from punycode'; } getId(): string { - return "decodepunycode"; + return 'decodepunycode'; } convert(input: string): string { diff --git a/src/app/converter/punycodeencoder.ts b/src/app/converter/punycodeencoder.ts index d6c153a..ebf8b67 100644 --- a/src/app/converter/punycodeencoder.ts +++ b/src/app/converter/punycodeencoder.ts @@ -1,5 +1,5 @@ -import {Converter} from "./converter"; -import {NativeLibraryWrapperService} from "../nativelibrarywrapper.service"; +import {Converter} from './converter'; +import {NativeLibraryWrapperService} from '../nativelibrarywrapper.service'; export class PunycodeEncoder implements Converter { @@ -7,11 +7,11 @@ export class PunycodeEncoder implements Converter { } getDisplayname(): string { - return "Encode as punycode"; + return 'Encode as punycode'; } getId(): string { - return "encodepunycode"; + return 'encodepunycode'; } convert(input: string): string { diff --git a/src/app/converter/quotedprintabledecoder.ts b/src/app/converter/quotedprintabledecoder.ts index 8294123..9c43014 100644 --- a/src/app/converter/quotedprintabledecoder.ts +++ b/src/app/converter/quotedprintabledecoder.ts @@ -1,5 +1,5 @@ -import {Converter} from "./converter"; -import {NativeLibraryWrapperService} from "../nativelibrarywrapper.service"; +import {Converter} from './converter'; +import {NativeLibraryWrapperService} from '../nativelibrarywrapper.service'; export class QuotedPrintableDecoder implements Converter { @@ -7,18 +7,18 @@ export class QuotedPrintableDecoder implements Converter { } getDisplayname(): string { - return "Decode quoted printable"; + return 'Decode quoted printable'; } getId(): string { - return "decodequotedprintable"; + return 'decodequotedprintable'; } convert(input: string): string { try { return this.nativeLibraryWrapperService.quotedPrintable.decode(input); } catch (error) { - throw new Error("The input can not be interpreted as quoted-printable. May be corrupt?"); + throw new Error('The input can not be interpreted as quoted-printable. May be corrupt?'); } } } diff --git a/src/app/converter/quotedprintableencoder.ts b/src/app/converter/quotedprintableencoder.ts index ff71df5..17cbb32 100644 --- a/src/app/converter/quotedprintableencoder.ts +++ b/src/app/converter/quotedprintableencoder.ts @@ -1,5 +1,5 @@ -import {Converter} from "./converter"; -import {NativeLibraryWrapperService} from "../nativelibrarywrapper.service"; +import {Converter} from './converter'; +import {NativeLibraryWrapperService} from '../nativelibrarywrapper.service'; export class QuotedPrintableEncoder implements Converter { @@ -7,11 +7,11 @@ export class QuotedPrintableEncoder implements Converter { } getDisplayname(): string { - return "Encode quoted printable"; + return 'Encode quoted printable'; } getId(): string { - return "encodequotedprintable"; + return 'encodequotedprintable'; } convert(input: string): string { diff --git a/src/app/converter/uricomponentdecoder.ts b/src/app/converter/uricomponentdecoder.ts index e59fa7f..24750d7 100644 --- a/src/app/converter/uricomponentdecoder.ts +++ b/src/app/converter/uricomponentdecoder.ts @@ -1,12 +1,12 @@ -import {Converter} from "./converter"; +import {Converter} from './converter'; export class URIComponentDecoder implements Converter { getDisplayname(): string { - return "Decode URI component"; + return 'Decode URI component'; } getId(): string { - return "uricomponentdecode"; + return 'uricomponentdecode'; } convert(input: string): string { diff --git a/src/app/converter/uricomponentencoder.ts b/src/app/converter/uricomponentencoder.ts index fa5bd18..b529623 100644 --- a/src/app/converter/uricomponentencoder.ts +++ b/src/app/converter/uricomponentencoder.ts @@ -1,12 +1,12 @@ -import {Converter} from "./converter"; +import {Converter} from './converter'; export class URIComponentEncoder implements Converter { getDisplayname(): string { - return "Encode URI component"; + return 'Encode URI component'; } getId(): string { - return "uricomponentencode"; + return 'uricomponentencode'; } convert(input: string): string { diff --git a/src/app/converter/uridecoder.ts b/src/app/converter/uridecoder.ts index 3eabd21..0e52b47 100644 --- a/src/app/converter/uridecoder.ts +++ b/src/app/converter/uridecoder.ts @@ -1,12 +1,12 @@ -import {Converter} from "./converter"; +import {Converter} from './converter'; export class URIDecoder implements Converter { getDisplayname(): string { - return "Decode URI"; + return 'Decode URI'; } getId(): string { - return "uridecode"; + return 'uridecode'; } convert(input: string): string { diff --git a/src/app/converter/uriencoder.ts b/src/app/converter/uriencoder.ts index b2c61d4..b7d2173 100644 --- a/src/app/converter/uriencoder.ts +++ b/src/app/converter/uriencoder.ts @@ -1,12 +1,12 @@ -import {Converter} from "./converter"; +import {Converter} from './converter'; export class URIEncoder implements Converter { getDisplayname(): string { - return "Encode URI"; + return 'Encode URI'; } getId(): string { - return "uriencode"; + return 'uriencode'; } convert(input: string): string { diff --git a/src/app/converter/utf8decoder.ts b/src/app/converter/utf8decoder.ts index e14974c..7f19a76 100644 --- a/src/app/converter/utf8decoder.ts +++ b/src/app/converter/utf8decoder.ts @@ -1,5 +1,5 @@ -import {Converter} from "./converter"; -import {NativeLibraryWrapperService} from "../nativelibrarywrapper.service"; +import {Converter} from './converter'; +import {NativeLibraryWrapperService} from '../nativelibrarywrapper.service'; export class UTF8Decoder implements Converter { @@ -7,18 +7,18 @@ export class UTF8Decoder implements Converter { } getDisplayname(): string { - return "Decode UTF-8"; + return 'Decode UTF-8'; } getId(): string { - return "decodeutf8"; + return 'decodeutf8'; } convert(input: string): string { try { return this.nativeLibraryWrapperService.utf8.decode(input); } catch (error) { - throw new Error("The input can not be interpreted a valid UTF-8 encoded string. May be corrupt?"); + throw new Error('The input can not be interpreted a valid UTF-8 encoded string. May be corrupt?'); } } } diff --git a/src/app/converter/utf8encoder.ts b/src/app/converter/utf8encoder.ts index 88241de..7e911d4 100644 --- a/src/app/converter/utf8encoder.ts +++ b/src/app/converter/utf8encoder.ts @@ -1,5 +1,5 @@ -import {Converter} from "./converter"; -import {NativeLibraryWrapperService} from "../nativelibrarywrapper.service"; +import {Converter} from './converter'; +import {NativeLibraryWrapperService} from '../nativelibrarywrapper.service'; export class UTF8Encoder implements Converter { @@ -7,18 +7,18 @@ export class UTF8Encoder implements Converter { } getDisplayname(): string { - return "Encode UTF-8"; + return 'Encode UTF-8'; } getId(): string { - return "encodeutf8"; + return 'encodeutf8'; } convert(input: string): string { try { return this.nativeLibraryWrapperService.utf8.encode(input); } catch (error) { - throw new Error("The input can not be encoded as UTF-8. May be corrupt?"); + throw new Error('The input can not be encoded as UTF-8. May be corrupt?'); } } } diff --git a/src/app/converterregistry.service.ts b/src/app/converterregistry.service.ts index f00d980..4e4bf1a 100644 --- a/src/app/converterregistry.service.ts +++ b/src/app/converterregistry.service.ts @@ -1,24 +1,24 @@ -import {Injectable} from "@angular/core"; -import {Converter} from "./converter/converter"; -import {Base64Encoder} from "./converter/base64encoder"; -import {Base64Decoder} from "./converter/base64decoder"; -import {URIEncoder} from "./converter/uriencoder"; -import {URIDecoder} from "./converter/uridecoder"; -import {URIComponentEncoder} from "./converter/uricomponentencoder"; -import {URIComponentDecoder} from "./converter/uricomponentdecoder"; -import {HTMLEntitiesEncoder} from "./converter/htmlentitiesencoder"; -import {HTMLEntitiesDecoder} from "./converter/htmlentitiesdecoder"; -import {DecToHexConverter} from "./converter/dectohexconverter"; -import {HexToDecConverter} from "./converter/hextodecconverter"; -import {DecToBinConverter} from "./converter/dectobinconverter"; -import {BinToDecConverter} from "./converter/bintodecconverter"; -import {QuotedPrintableDecoder} from "./converter/quotedprintabledecoder"; -import {QuotedPrintableEncoder} from "./converter/quotedprintableencoder"; -import {NativeLibraryWrapperService} from "./nativelibrarywrapper.service"; -import {PunycodeEncoder} from "./converter/punycodeencoder"; -import {PunycodeDecoder} from "./converter/punycodedecoder"; -import {UTF8Encoder} from "./converter/utf8encoder"; -import {UTF8Decoder} from "./converter/utf8decoder"; +import {Injectable} from '@angular/core'; +import {Converter} from './converter/converter'; +import {Base64Encoder} from './converter/base64encoder'; +import {Base64Decoder} from './converter/base64decoder'; +import {URIEncoder} from './converter/uriencoder'; +import {URIDecoder} from './converter/uridecoder'; +import {URIComponentEncoder} from './converter/uricomponentencoder'; +import {URIComponentDecoder} from './converter/uricomponentdecoder'; +import {HTMLEntitiesEncoder} from './converter/htmlentitiesencoder'; +import {HTMLEntitiesDecoder} from './converter/htmlentitiesdecoder'; +import {DecToHexConverter} from './converter/dectohexconverter'; +import {HexToDecConverter} from './converter/hextodecconverter'; +import {DecToBinConverter} from './converter/dectobinconverter'; +import {BinToDecConverter} from './converter/bintodecconverter'; +import {QuotedPrintableDecoder} from './converter/quotedprintabledecoder'; +import {QuotedPrintableEncoder} from './converter/quotedprintableencoder'; +import {NativeLibraryWrapperService} from './nativelibrarywrapper.service'; +import {PunycodeEncoder} from './converter/punycodeencoder'; +import {PunycodeDecoder} from './converter/punycodedecoder'; +import {UTF8Encoder} from './converter/utf8encoder'; +import {UTF8Decoder} from './converter/utf8decoder'; @Injectable() export class ConverterRegistryService { @@ -34,7 +34,7 @@ export class ConverterRegistryService { public getConverter(id: string): Converter { for (let i = 0; i < this.converters.length; i++) { - if (this.converters[i].getId() == id) { + if (this.converters[i].getId() === id) { return this.converters[i]; } } @@ -64,8 +64,8 @@ export class ConverterRegistryService { private registerConverter(converter: Converter): void { this.converters.forEach((c: Converter) => { - if (c.getId() == converter.getId()) { - throw new Error("Converter-ID " + converter.getId() + " is already registered!"); + if (c.getId() === converter.getId()) { + throw new Error('Converter-ID ' + converter.getId() + ' is already registered!'); } }); this.converters.push(converter); diff --git a/src/app/inputcomponentmanager.service.ts b/src/app/inputcomponentmanager.service.ts index 04d0ed3..136d1b6 100644 --- a/src/app/inputcomponentmanager.service.ts +++ b/src/app/inputcomponentmanager.service.ts @@ -1,5 +1,5 @@ -import {Injectable} from "@angular/core"; -import {Step} from "./step"; +import {Injectable} from '@angular/core'; +import {Step} from './step'; @Injectable() export class InputComponentManagerService { @@ -17,15 +17,15 @@ export class InputComponentManagerService { } public getNext(component: Step): Step { - let index: number = component.index; - if (index == this.components.length - 1) { + const index: number = component.index; + if (index === this.components.length - 1) { this.addComponent(); } return this.components[index + 1]; } public getFirst(): Step { - if (this.components.length == 0) { + if (this.components.length === 0) { this.addComponent(); } return this.components[0]; diff --git a/src/app/nativelibrarywrapper.service.ts b/src/app/nativelibrarywrapper.service.ts index dd4625c..f3ce6af 100644 --- a/src/app/nativelibrarywrapper.service.ts +++ b/src/app/nativelibrarywrapper.service.ts @@ -1,10 +1,10 @@ -import {Injectable} from "@angular/core"; -import {Punycode} from "./punycode"; -import {Utf8} from "./utf8"; -import {QuotedPrintable} from "./quotedprintable"; -import * as NativeUtf8 from "utf8"; -import * as NativeQuotedPrintable from "quoted-printable"; -import * as NativePunycode from "punycode"; +import {Injectable} from '@angular/core'; +import {Punycode} from './punycode'; +import {Utf8} from './utf8'; +import {QuotedPrintable} from './quotedprintable'; +import * as NativeUtf8 from 'utf8'; +import * as NativeQuotedPrintable from 'quoted-printable'; +import * as NativePunycode from 'punycode'; @Injectable() export class NativeLibraryWrapperService { diff --git a/src/app/step.ts b/src/app/step.ts index ca6f809..ff63f97 100644 --- a/src/app/step.ts +++ b/src/app/step.ts @@ -1,11 +1,11 @@ -import {Converter} from "./converter/converter"; +import {Converter} from './converter/converter'; export class Step { - public content: string = ""; + public content = ''; public selectedConverter: Converter = undefined; public index: number; - public error: boolean = false; - public message: string = ""; + public error = false; + public message = ''; constructor(index: number) { this.index = index; diff --git a/src/main.ts b/src/main.ts index 8c63461..57d0769 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,8 +1,8 @@ -import {enableProdMode} from "@angular/core"; -import {platformBrowserDynamic} from "@angular/platform-browser-dynamic"; +import {enableProdMode} from '@angular/core'; +import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; -import {AppModule} from "./app/app.module"; -import {environment} from "./environments/environment"; +import {AppModule} from './app/app.module'; +import {environment} from './environments/environment'; if (environment.production) { enableProdMode(); diff --git a/src/polyfills.ts b/src/polyfills.ts index cbb067b..44fdfcf 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -17,32 +17,32 @@ * BROWSER POLYFILLS */ /** IE9, IE10 and IE11 requires all of the following polyfills. **/ -import "core-js/es6/symbol"; -import "core-js/es6/object"; -import "core-js/es6/function"; -import "core-js/es6/parse-int"; -import "core-js/es6/parse-float"; -import "core-js/es6/number"; -import "core-js/es6/math"; -import "core-js/es6/string"; -import "core-js/es6/date"; -import "core-js/es6/array"; -import "core-js/es6/regexp"; -import "core-js/es6/map"; -import "core-js/es6/set"; +import 'core-js/es6/symbol'; +import 'core-js/es6/object'; +import 'core-js/es6/function'; +import 'core-js/es6/parse-int'; +import 'core-js/es6/parse-float'; +import 'core-js/es6/number'; +import 'core-js/es6/math'; +import 'core-js/es6/string'; +import 'core-js/es6/date'; +import 'core-js/es6/array'; +import 'core-js/es6/regexp'; +import 'core-js/es6/map'; +import 'core-js/es6/set'; /** IE10 and IE11 requires the following for NgClass support on SVG elements */ // import 'classlist.js'; // Run `npm install --save classlist.js`. /** IE10 and IE11 requires the following to support `@angular/animation`. */ // import 'web-animations-js'; // Run `npm install --save web-animations-js`. /** Evergreen browsers require these. **/ -import "core-js/es6/reflect"; -import "core-js/es7/reflect"; +import 'core-js/es6/reflect'; +import 'core-js/es7/reflect'; /** ALL Firefox browsers require the following to support `@angular/animation`. **/ // import 'web-animations-js'; // Run `npm install --save web-animations-js`. /*************************************************************************************************** * Zone JS is required by Angular itself. */ -import "zone.js/dist/zone"; // Included with Angular CLI. +import 'zone.js/dist/zone'; // Included with Angular CLI. /*************************************************************************************************** diff --git a/src/test.ts b/src/test.ts index c05faf1..ece343b 100644 --- a/src/test.ts +++ b/src/test.ts @@ -1,13 +1,13 @@ // This file is required by karma.conf.js and loads recursively all the .spec and framework files -import "zone.js/dist/long-stack-trace-zone"; -import "zone.js/dist/proxy.js"; -import "zone.js/dist/sync-test"; -import "zone.js/dist/jasmine-patch"; -import "zone.js/dist/async-test"; -import "zone.js/dist/fake-async-test"; -import {getTestBed} from "@angular/core/testing"; -import {BrowserDynamicTestingModule, platformBrowserDynamicTesting} from "@angular/platform-browser-dynamic/testing"; +import 'zone.js/dist/long-stack-trace-zone'; +import 'zone.js/dist/proxy.js'; +import 'zone.js/dist/sync-test'; +import 'zone.js/dist/jasmine-patch'; +import 'zone.js/dist/async-test'; +import 'zone.js/dist/fake-async-test'; +import {getTestBed} from '@angular/core/testing'; +import {BrowserDynamicTestingModule, platformBrowserDynamicTesting} from '@angular/platform-browser-dynamic/testing'; // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. declare const __karma__: any;