lhorie/mithril.js — pull request #255 by Naddiseo (2014-09-18 00:31:51+00:00)
Title: Created common functions for typeof

As I mentioned in #251 I'd been thinking about some refactoring of the type functions, and a little code golf.
This PR moves most of the type checking to separate functions, and pulls out the "[object Object]" and "[object Array]" constants.

Code size savings (not sure why the compression isn't as good):

File | Before | After | Savings
----- | ----------- | -------- | -------
mithril.js | 33028 | 32811 | 217
mithril.min.js | 14515 | 14230 | 285
mithril.min.js + xz | 5712 | 5708 | 4
mithril.min.js + gzip | 5813 | 5821 | -8
mithril.min.js + zip | 5939 | 5947|-8
mithril.min.js + bzip | 5716 | 5730 |-14