ktsn / vuex-assert

Assertion for Vuex state

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove assertion related codes on production environment

ktsn opened this issue · comments

Maybe should implement another package like unassert?

It would not worth implementing dedicated unassert-like tool, just use process.env.NODE_ENV !== 'production' pattern is enough.

const module = {
  state: { /* .... */ },
  // ...
}

if (process.env.NODE_ENV !== 'production') {
  module.assertions = { /* ... */ }
}

export default module