Skip to content

Commit

Permalink
ts: enable strict null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
hamiltoes committed May 14, 2020
1 parent 0af97a1 commit 99ae8a2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { initAuth, hydrateApi } from './utils'
import { FeathersVuex } from './vue-plugin/vue-plugin'
const events = ['created', 'patched', 'updated', 'removed']

const defaults: FeathersVuexOptions = {
const defaults: Required<FeathersVuexOptions> = {
autoRemove: false, // Automatically remove records missing from responses (only use with feathers-rest)
addOnUpsert: false, // Add new records pushed by 'updated/patched' socketio events into store, instead of discarding them
enableEvents: true, // Listens to socket.io events when available
Expand Down Expand Up @@ -64,7 +64,7 @@ export default function feathersVuex(feathers, options: FeathersVuexOptions) {

addClient({ client: feathers, serverAlias: options.serverAlias })

const BaseModel = makeBaseModel(options)
const BaseModel = makeBaseModel(options as Required<FeathersVuexOptions>)
const makeServicePlugin = prepareMakeServicePlugin(options)
const makeAuthPlugin = prepareMakeAuthPlugin(feathers, options)

Expand Down
2 changes: 1 addition & 1 deletion src/service-module/make-base-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const defaultOptions = {
*
* @param options
*/
export default function makeBaseModel(options: FeathersVuexOptions) {
export default function makeBaseModel(options: Required<FeathersVuexOptions>) {
const addModel = prepareAddModel(options)
const { serverAlias } = options

Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"moduleResolution": "node",
"target": "es6",
"sourceMap": false,
"declaration": true
"declaration": true,
"strictNullChecks": true
},
"include": ["src/**/*"],
"exclude": ["node_modules", "**/*.test.js"]
Expand Down

0 comments on commit 99ae8a2

Please sign in to comment.