Skip to content

Commit

Permalink
feat: upgrade TypeScript version to 3.1.3
Browse files Browse the repository at this point in the history
BREAKING CHANGE: TypeScript version 2.7.2 changed to 3.1.3
  • Loading branch information
pathurs committed Oct 28, 2018
1 parent 44c79b2 commit a3785a5
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
1 change: 1 addition & 0 deletions gulpfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ enum TestOutput {
}

@TSGulp.Project('DataSource')
// @ts-ignore: Allow unused class
class GulpFile {
public readonly tsProject = typescript.createProject('./src/tsconfig.json');
public readonly tsLintProgram = TSlint.Linter.createProgram('./src/tsconfig.json');
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"stream-to-promise": "^2.2.0",
"tsgulp": "^1.1.2",
"tslint": "^5.10.0",
"typescript": "~2.7.2"
"typescript": "^3.1.3"
},
"dependencies": {
"tslib": "^1.9.3"
Expand Down
1 change: 1 addition & 0 deletions src/processors/complex.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ComplexProcessor } from './complex';
import { SimpleProcessor } from './simple';

class TestableComplexProcessor<T> extends ComplexProcessor<T> {
// @ts-ignore: Allow unused parameter
protected processor(data: T): T {
throw new Error('Method not implemented.');
}
Expand Down
6 changes: 4 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ export type Finder<T> = (item: T, index: number, array: T[]) => boolean;
export function find<T>(array: T[], item: T): T | undefined;
export function find<T>(array: T[], finder: Finder<T>): T | undefined;
export function find<T>(array: T[], itemOrFinder: T | Finder<T>) {
const finder: Finder<T> = typeof itemOrFinder === 'function' ? itemOrFinder : item => item === itemOrFinder;
const finder: Finder<T> =
typeof itemOrFinder === 'function' ? <Finder<T>>itemOrFinder : item => item === itemOrFinder;

for (let i = 0; i < array.length; i++) {
if (finder(array[i], i, array)) {
Expand All @@ -44,7 +45,8 @@ export function find<T>(array: T[], itemOrFinder: T | Finder<T>) {
export function findIndex<T>(array: T[], item: T): number;
export function findIndex<T>(array: T[], finder: Finder<T>): number;
export function findIndex<T>(array: T[], itemOrFinder: T | Finder<T>) {
const finder: Finder<T> = typeof itemOrFinder === 'function' ? itemOrFinder : item => item === itemOrFinder;
const finder: Finder<T> =
typeof itemOrFinder === 'function' ? <Finder<T>>itemOrFinder : item => item === itemOrFinder;

for (let i = 0; i < array.length; i++) {
if (finder(array[i], i, array)) {
Expand Down
8 changes: 5 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
{
"compilerOptions": {
"alwaysStrict": true,
"declaration": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"importHelpers": true,
"module": "commonjs",
"moduleResolution": "node",
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"strict": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"declaration": true,
"strictPropertyInitialization": true,
"importHelpers": true,
"moduleResolution": "node",
"target": "es6"
},
"include": ["gulpfile.ts"]
Expand Down

0 comments on commit a3785a5

Please sign in to comment.