Simplified types.js code with magicpen@2.1 features