switch to idiomatic.js typeof use