two.js
two.js copied to clipboard
Make Two.Utils private?
Currently, there's a lot of stuff in Two.Utils that was copied in from Underscore.
It looks like some work has already been put into reducing the use of Underscore in Two.js, but Two.Utils could be further cut down and maybe made private so that it can change to suit Two.js' needs without worries of breaking external code which relies on it.
This would break any Two.js projects currently using public Two.Utils functions, so perhaps it would be a good candidate for 0.8.0?
I think this is a good idea. What in your mind could be further cut down? I think in some ways this is symptomatic of a larger issue which I think ES6 Modules would fix.
A lot of the "is" functions (isUndefined
, isNumber
, isString
, etc.) can be replaced with typeof
checks.
In addition, there are certain functions like values
(and several "is" functions) that are never used in the codebase, and functions like map
, each
, bind
, and isArray
that can be replaced with native methods.
I've done some work in this branch
Cool, I'll keep on eye on that branch!