mblarsen / mongoose-hidden

A Mongoose schema plugin for filtering properties you usually do not want to sent client-side like passwords and IDs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

undefine is not defined

aa403210842 opened this issue · comments

i found a spelling mistake

line 86 ~95

function getPath(obj, path) {
  let parts = path.split('.')
  while (parts.length) {
    obj = obj[parts.shift()]
    if (typeof obj !== 'object' && parts.length) {
      return undefine // here
    }
  }
  return obj
}

@aa403210842 strange, that part was covered by the tests. What environment are you running on?

@aa403210842 No I was mistaken. That case is not covered by the test. Can you give me an example of what caused it and I'll add a test case for it? (if not I'll figure it out).

https://coveralls.io/builds/9325729/source?filename=lib%2Fmongoose-hidden.js#L91

UPDATE no need to provide data, I'm extending tests. Note that 0.9.1 has already been published with this fix.