Skip to content

Commit 9fce0cd

Browse files
committed
chore: upgrade to TypeScript 3.5
1 parent c5eb4d5 commit 9fce0cd

35 files changed

+101
-89
lines changed

examples/express-composition/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/express-composition/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@
6161
"@types/express": "^4.16.1",
6262
"@types/node": "^10.11.2",
6363
"tslint": "^5.16.0",
64-
"typescript": "^3.4.5"
64+
"typescript": "^3.5.1"
6565
}
6666
}

examples/express-composition/src/controllers/note.controller.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ import {
1111
Where,
1212
} from '@loopback/repository';
1313
import {
14-
post,
15-
param,
14+
del,
1615
get,
1716
getFilterSchemaFor,
1817
getWhereSchemaFor,
18+
param,
1919
patch,
20+
post,
2021
put,
21-
del,
2222
requestBody,
2323
} from '@loopback/rest';
2424
import {Note} from '../models';
@@ -51,7 +51,7 @@ export class NoteController {
5151
},
5252
})
5353
async count(
54-
@param.query.object('where', getWhereSchemaFor(Note)) where?: Where,
54+
@param.query.object('where', getWhereSchemaFor(Note)) where?: Where<Note>,
5555
): Promise<Count> {
5656
return await this.noteRepository.count(where);
5757
}
@@ -69,7 +69,8 @@ export class NoteController {
6969
},
7070
})
7171
async find(
72-
@param.query.object('filter', getFilterSchemaFor(Note)) filter?: Filter,
72+
@param.query.object('filter', getFilterSchemaFor(Note))
73+
filter?: Filter<Note>,
7374
): Promise<Note[]> {
7475
return await this.noteRepository.find(filter);
7576
}
@@ -84,7 +85,7 @@ export class NoteController {
8485
})
8586
async updateAll(
8687
@requestBody() note: Note,
87-
@param.query.object('where', getWhereSchemaFor(Note)) where?: Where,
88+
@param.query.object('where', getWhereSchemaFor(Note)) where?: Where<Note>,
8889
): Promise<Count> {
8990
return await this.noteRepository.updateAll(note, where);
9091
}

examples/greeter-extension/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/greeter-extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"@types/debug": "4.1.4",
5050
"@types/node": "^10.11.2",
5151
"tslint": "^5.16.0",
52-
"typescript": "^3.4.5"
52+
"typescript": "^3.5.1"
5353
},
5454
"dependencies": {
5555
"@loopback/context": "^1.16.0",

examples/hello-world/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/hello-world/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"@loopback/tslint-config": "^2.0.4",
4747
"@types/node": "^10.11.2",
4848
"tslint": "^5.16.0",
49-
"typescript": "^3.4.5"
49+
"typescript": "^3.5.1"
5050
},
5151
"keywords": [
5252
"loopback",

examples/lb3-application/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/lb3-application/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"@types/node": "^10.11.2",
6060
"lodash": "^4.17.11",
6161
"tslint": "^5.16.0",
62-
"typescript": "^3.4.5"
62+
"typescript": "^3.5.1"
6363
},
6464
"keywords": [
6565
"loopback",

examples/log-extension/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/log-extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"@types/debug": "^4.1.4",
4949
"@types/node": "^10.11.2",
5050
"tslint": "^5.16.0",
51-
"typescript": "^3.4.5"
51+
"typescript": "^3.5.1"
5252
},
5353
"dependencies": {
5454
"@loopback/context": "^1.16.0",

examples/rpc-server/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/rpc-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@
5050
"@types/express": "^4.11.1",
5151
"@types/node": "^10.11.2",
5252
"tslint": "^5.16.0",
53-
"typescript": "^3.4.5"
53+
"typescript": "^3.5.1"
5454
}
5555
}

examples/soap-calculator/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/soap-calculator/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@
6060
"mocha": "^6.1.3",
6161
"source-map-support": "^0.5.5",
6262
"tslint": "^5.16.0",
63-
"typescript": "^3.4.5"
63+
"typescript": "^3.5.1"
6464
}
6565
}

examples/todo-list/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/todo-list/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"@types/node": "^10.11.2",
5757
"lodash": "^4.17.10",
5858
"tslint": "^5.16.0",
59-
"typescript": "^3.4.5"
59+
"typescript": "^3.5.1"
6060
},
6161
"keywords": [
6262
"loopback",

examples/todo-list/src/__tests__/unit/controllers/todo-list-todo.controller.unit.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// License text available at https://opensource.org/licenses/MIT
55

66
import {
7+
Count,
78
DefaultHasManyRepository,
89
HasManyRepository,
910
} from '@loopback/repository';
@@ -32,7 +33,8 @@ describe('TodoController', () => {
3233
in our tests themselves.
3334
=============================================================================
3435
*/
35-
let todos: sinon.SinonStub;
36+
// tslint:disable:no-any
37+
let todos: sinon.SinonStub<any[], Todo[]>;
3638

3739
/*
3840
=============================================================================
@@ -42,10 +44,11 @@ describe('TodoController', () => {
4244
in our tests themselves.
4345
=============================================================================
4446
*/
45-
let create: sinon.SinonStub;
46-
let find: sinon.SinonStub;
47-
let patch: sinon.SinonStub;
48-
let del: sinon.SinonStub;
47+
let create: sinon.SinonStub<any[], Promise<Todo>>;
48+
let find: sinon.SinonStub<any[], Promise<Todo[]>>;
49+
let patch: sinon.SinonStub<any[], Promise<Count>>;
50+
let del: sinon.SinonStub<any[], Promise<Count>>;
51+
// tslint:enable:no-any
4952

5053
/*
5154
=============================================================================
@@ -98,7 +101,7 @@ describe('TodoController', () => {
98101

99102
describe('patch()', () => {
100103
it('returns a number of todos updated', async () => {
101-
patch.resolves([aChangedTodo].length);
104+
patch.resolves({count: [aChangedTodo].length});
102105
const where = {title: aTodoWithId.title};
103106
expect(
104107
await controller.patch(aTodoListWithId.id!, aTodoToPatchTo, where),
@@ -110,7 +113,7 @@ describe('TodoController', () => {
110113

111114
describe('deleteAll()', () => {
112115
it('successfully deletes existing items', async () => {
113-
del.resolves(aListOfTodos.length);
116+
del.resolves({count: aListOfTodos.length});
114117
expect(await controller.delete(aTodoListWithId.id!)).to.eql(
115118
aListOfTodos.length,
116119
);
@@ -155,7 +158,8 @@ describe('TodoController', () => {
155158
(todoListRepo as any).todos = todos;
156159

157160
// Setup CRUD fakes
158-
({create, find, patch, delete: del} = constrainedTodoRepo.stubs);
161+
// tslint:disable-next-line:no-any
162+
({create, find, patch, delete: del} = constrainedTodoRepo.stubs as any);
159163

160164
controller = new TodoListTodoController(todoListRepo);
161165
}

examples/todo-list/src/controllers/todo-list-todo.controller.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class TodoListTodoController {
5656
})
5757
async find(
5858
@param.path.number('id') id: number,
59-
@param.query.object('filter') filter?: Filter,
59+
@param.query.object('filter') filter?: Filter<Todo>,
6060
): Promise<Todo[]> {
6161
return await this.todoListRepo.todos(id).find(filter);
6262
}
@@ -72,7 +72,7 @@ export class TodoListTodoController {
7272
async patch(
7373
@param.path.number('id') id: number,
7474
@requestBody() todo: Partial<Todo>,
75-
@param.query.object('where', getWhereSchemaFor(Todo)) where?: Where,
75+
@param.query.object('where', getWhereSchemaFor(Todo)) where?: Where<Todo>,
7676
): Promise<Count> {
7777
return await this.todoListRepo.todos(id).patch(todo, where);
7878
}
@@ -87,7 +87,7 @@ export class TodoListTodoController {
8787
})
8888
async delete(
8989
@param.path.number('id') id: number,
90-
@param.query.object('where', getWhereSchemaFor(Todo)) where?: Where,
90+
@param.query.object('where', getWhereSchemaFor(Todo)) where?: Where<Todo>,
9191
): Promise<Count> {
9292
return await this.todoListRepo.todos(id).delete(where);
9393
}

examples/todo-list/src/controllers/todo-list.controller.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ export class TodoListController {
5050
},
5151
})
5252
async count(
53-
@param.query.object('where', getWhereSchemaFor(TodoList)) where?: Where,
53+
@param.query.object('where', getWhereSchemaFor(TodoList))
54+
where?: Where<TodoList>,
5455
): Promise<Count> {
5556
return await this.todoListRepository.count(where);
5657
}
@@ -64,7 +65,8 @@ export class TodoListController {
6465
},
6566
})
6667
async find(
67-
@param.query.object('filter', getFilterSchemaFor(TodoList)) filter?: Filter,
68+
@param.query.object('filter', getFilterSchemaFor(TodoList))
69+
filter?: Filter<TodoList>,
6870
): Promise<TodoList[]> {
6971
return await this.todoListRepository.find(filter);
7072
}
@@ -79,7 +81,8 @@ export class TodoListController {
7981
})
8082
async updateAll(
8183
@requestBody() obj: Partial<TodoList>,
82-
@param.query.object('where', getWhereSchemaFor(TodoList)) where?: Where,
84+
@param.query.object('where', getWhereSchemaFor(TodoList))
85+
where?: Where<TodoList>,
8386
): Promise<Count> {
8487
return await this.todoListRepository.updateAll(obj, where);
8588
}

examples/todo-list/src/controllers/todo.controller.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ export class TodoController {
6060
},
6161
})
6262
async findTodos(
63-
@param.query.object('filter', getFilterSchemaFor(Todo)) filter?: Filter,
63+
@param.query.object('filter', getFilterSchemaFor(Todo))
64+
filter?: Filter<Todo>,
6465
): Promise<Todo[]> {
6566
return await this.todoRepo.find(filter);
6667
}

examples/todo/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/todo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"@types/node": "^10.11.2",
5757
"lodash": "^4.17.10",
5858
"tslint": "^5.16.0",
59-
"typescript": "^3.4.5"
59+
"typescript": "^3.5.1"
6060
},
6161
"keywords": [
6262
"loopback",

examples/todo/src/__tests__/unit/controllers/todo.controller.unit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ describe('TodoController', () => {
100100

101101
it('uses the provided filter', async () => {
102102
const find = todoRepo.stubs.find;
103-
const filter: Filter = {where: {isCompleted: false}};
103+
const filter: Filter<Todo> = {where: {isComplete: false}};
104104

105105
find.resolves(aListOfTodos);
106106
await controller.findTodos(filter);

examples/todo/src/controllers/todo.controller.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ export class TodoController {
7373
},
7474
})
7575
async findTodos(
76-
@param.query.object('filter', getFilterSchemaFor(Todo)) filter?: Filter,
76+
@param.query.object('filter', getFilterSchemaFor(Todo))
77+
filter?: Filter<Todo>,
7778
): Promise<Todo[]> {
7879
return await this.todoRepo.find(filter);
7980
}

0 commit comments

Comments
 (0)