Simple type checking for JavaScript in the browser and node.js