simple sane javascript type checker