Skip to content

Commit 250901d

Browse files
Merge pull request #365 from jeffborg/master
remove @ts-ignores
2 parents 641eba1 + 247a3ac commit 250901d

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

src/make-find-mixin.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,7 @@ export default function makeFindMixin(options) {
189189

190190
this[HAVE_ITEMS_LOADED_ONCE] = true
191191
const queryInfo = getQueryInfo(paramsToUse, response)
192-
// @ts-ignore
193192
queryInfo.response = response
194-
// @ts-ignore
195193
queryInfo.isOutdated = false
196194

197195
this[MOST_RECENT_QUERY] = queryInfo

src/service-module/service-module.getters.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export default function makeServiceGetters() {
4242
values = values.concat(_.values(state.tempsById))
4343
}
4444

45-
//@ts-ignore
4645
values = values.filter(sift(query))
4746

4847
const total = values.length

src/service-module/service-module.state.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ export default function makeDefaultState(servicePath, options) {
4242
errorOnCreate: null,
4343
errorOnUpdate: null,
4444
errorOnPatch: null,
45-
errorOnRemove: null
45+
errorOnRemove: null,
46+
modelName: null as string | null
4647
}
4748

4849
if (options.Model) {
49-
// @ts-ignore
5050
state.modelName = options.Model.modelName
5151
}
5252

src/utils.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import _get from 'lodash/get'
1515
import ObjectID from 'bson-objectid'
1616
import { globalModels as models } from './service-module/global-models'
1717
import stringify from 'fast-json-stable-stringify'
18+
import { Service } from '@feathersjs/feathers'
1819

1920
interface Query {
2021
[key: string]: any
@@ -307,10 +308,9 @@ export function updateOriginal(original, newData) {
307308
})
308309
}
309310

310-
//@ts-ignore
311-
export function getQueryInfo(params: Params = {}, response: Paginated = {}) {
311+
export function getQueryInfo(params: Params = {}, response: Partial<Pick<Paginated<any>, 'limit' | 'skip'>> = {}) {
312312
const query = params.query || {}
313-
const qid = params.qid || 'default'
313+
const qid: string = params.qid || 'default'
314314
const $limit =
315315
response.limit !== null && response.limit !== undefined
316316
? response.limit
@@ -331,7 +331,9 @@ export function getQueryInfo(params: Params = {}, response: Paginated = {}) {
331331
queryId,
332332
queryParams,
333333
pageParams,
334-
pageId
334+
pageId,
335+
response: undefined,
336+
isOutdated: undefined as boolean | undefined
335337
}
336338
}
337339

@@ -362,17 +364,15 @@ export function makeNamespace(namespace, servicePath, nameStyle) {
362364
* @param service
363365
* @param modelName
364366
*/
365-
export function getServicePath(service: any, Model: 'any') {
366-
// @ts-ignore
367+
export function getServicePath(service: Service<any>, Model: any) {
367368
if (!service.name && !service.path && !Model.servicePath) {
368369
throw new Error(
369370
`Service for model named ${
370-
// @ts-ignore
371371
Model.name
372372
} is missing a path or name property. The feathers adapter needs to be updated with a PR to expose this property. You can work around this by adding a static servicePath = passing a 'servicePath' attribute in the options: makeServicePlugin({servicePath: '/path/to/my/service'})`
373373
)
374374
}
375-
// @ts-ignore
375+
376376
return service.path || service.name || Model.servicePath
377377
}
378378

0 commit comments

Comments
 (0)