nieldlr / hanzi

HanziJS is a Chinese character and NLP module for Chinese language processing for Node.js
http://hanzijs.com
MIT License
375 stars 56 forks source link

Bug/better type checking #57

Closed nieldlr closed 5 years ago

nieldlr commented 5 years ago

While building the HanziCraft react-native app, I noticed this line in the dictionarySearch was causing issues. It was evaluated as true by the react-native environment, which was bizarre. However, in theory the type checking done here was not very neat, so I changed it and fixed the bugs I was seeing. Still not sure why the non-empty search array == '' returned true in that environment. But that's probably going deep into different compilers/transpilers etc.

codecov-io commented 5 years ago

Codecov Report

Merging #57 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #57   +/-   ##
=======================================
  Coverage   87.77%   87.77%           
=======================================
  Files          15       15           
  Lines         548      548           
  Branches       91       91           
=======================================
  Hits          481      481           
  Misses         55       55           
  Partials       12       12
Impacted Files Coverage Δ
lib/dictionary.js 87.98% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 99abbb0...a63b2c2. Read the comment docs.