diff --git a/index.ts b/index.ts index c620c8a..6591399 100644 --- a/index.ts +++ b/index.ts @@ -1,4 +1,4 @@ -// Copyright (C) 2016 Sergey Akopkokhyants +// Copyright (C) 2016-2017 Sergey Akopkokhyants // This project is licensed under the terms of the MIT license. // https://github.com/akserg/ng2-toasty diff --git a/package.json b/package.json index 3eac9d7..ffab977 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,10 @@ "test": "karma start", "test-watch": "tsc && karma start --no-single-run --auto-watch", "commit": "npm run prepublish && npm test && git-cz", - "prepublish": "ngc && npm run build", - "build": "webpack && cp *.css bundles && cp -rf img bundles/img", - "semantic-release": "semantic-release pre && npm publish && semantic-release post" + "prepublish": "npm run build", + "build": "ngc --noUnusedParameters --noUnusedLocals && webpack && npm run minify && cp *.css bundles && rm -rf bundles/img && mkdir bundles/img && cp -rf img/*.* bundles/img", + "semantic-release": "semantic-release pre && npm publish && semantic-release post", + "minify": "./node_modules/uglify-js/bin/uglifyjs bundles/index.umd.js --screw-ie8 --compress --mangle --comments --output bundles/index.umd.min.js" }, "repository": { "type": "git", @@ -68,6 +69,7 @@ "tslint": "^5.4.3", "tslint-loader": "^3.5.3", "typescript": "^2.3.4", + "uglify-js": "^3.0.15", "webpack": "^2.6.1", "zone.js": "^0.8.12" }, diff --git a/src/shared.ts b/src/shared.ts index 226ff36..0a3c7ba 100644 --- a/src/shared.ts +++ b/src/shared.ts @@ -1,3 +1,7 @@ +// Copyright (C) 2016-2017 Sergey Akopkokhyants +// This project is licensed under the terms of the MIT license. +// https://github.com/akserg/ng2-toasty + import { DomSanitizer } from '@angular/platform-browser'; import { PipeTransform, Pipe } from '@angular/core'; diff --git a/src/toast.component.ts b/src/toast.component.ts index b014465..c60e26f 100644 --- a/src/toast.component.ts +++ b/src/toast.component.ts @@ -1,4 +1,4 @@ -// Copyright (C) 2016 Sergey Akopkokhyants +// Copyright (C) 2016-2017 Sergey Akopkokhyants // This project is licensed under the terms of the MIT license. // https://github.com/akserg/ng2-toasty diff --git a/src/toasty.component.ts b/src/toasty.component.ts index 44cc5b5..ec0ebaf 100644 --- a/src/toasty.component.ts +++ b/src/toasty.component.ts @@ -1,4 +1,4 @@ -// Copyright (C) 2016 Sergey Akopkokhyants +// Copyright (C) 2016-2017 Sergey Akopkokhyants // This project is licensed under the terms of the MIT license. // https://github.com/akserg/ng2-toasty diff --git a/src/toasty.service.ts b/src/toasty.service.ts index f744f03..1930f3a 100644 --- a/src/toasty.service.ts +++ b/src/toasty.service.ts @@ -1,4 +1,4 @@ -// Copyright (C) 2016 Sergey Akopkokhyants +// Copyright (C) 2016-2017 Sergey Akopkokhyants // This project is licensed under the terms of the MIT license. // https://github.com/akserg/ng2-toasty diff --git a/src/toasty.utils.ts b/src/toasty.utils.ts index 8c42dfd..d809f1b 100644 --- a/src/toasty.utils.ts +++ b/src/toasty.utils.ts @@ -1,20 +1,31 @@ + +// Copyright (C) 2016-2017 Sergey Akopkokhyants +// This project is licensed under the terms of the MIT license. +// https://github.com/akserg/ng2-toasty + /** * Check and return true if an object is type of string + * @param obj Analyse has to object the string type + * @return result of analysis */ -export function isString(obj:any) { +export function isString(obj: any): boolean { return typeof obj === "string"; } /** * Check and return true if an object is type of number + * @param obj Analyse has to object the boolean type + * @return result of analysis */ -export function isNumber(obj: any) { +export function isNumber(obj: any): boolean { return typeof obj === "number"; } /** * Check and return true if an object is type of Function + * @param obj Analyse has to object the function type + * @return result of analysis */ -export function isFunction(obj: any) { +export function isFunction(obj: any): boolean { return typeof obj === "function"; } diff --git a/tsconfig.json b/tsconfig.json index e346ac8..98d7744 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,15 +15,7 @@ "lib": ["es2015", "dom"] }, "files": [ - "index.ts", - "./src/shared.ts", - "./src/toast.component.ts", - "./src/toasty.component.ts", - "./src/toasty.service.ts", - "./src/toasty.utils.ts", - "tests/toast.component.spec.ts", - "tests/toasty.component.spec.ts", - "tests/toasty.service.spec.ts" + "index.ts" ], "exclude": [ "node_modules", diff --git a/tslint.json b/tslint.json index e7ad6e2..d78478f 100644 --- a/tslint.json +++ b/tslint.json @@ -31,8 +31,6 @@ "no-shadowed-variable": true, "no-string-literal": false, "no-unused-expression": true, - "no-unused-variable": true, - "no-use-before-declare": true, "object-literal-sort-keys": false, "one-line": [ true,