Sugar v1.1 Release Notes
-
API Changes
- Array#unique can now unique on a function, giving a shortcut to uniquify deep objects
- Object.equals renamed to Object.equal in its class method only
- Object.equal now much more robust, can handle cyclic references, etc
- Number#format now accepts a parameter for the decimal. "thousands", and "decimal" are pushed to 2nd and 3rd params
- ๐ Date#format now accepts different format tokens. A few counterintuitive ones removed, and others were added to match moment.js including fff, ddd, mmm, etc
- Function#lazy now executes immediately and locks instead of setting a delay
- โ Added RegExp#getFlags
- โ Added Function#fill, which allows arguments to be intelligently curried
- ๐ Fixed broken support for SpiderMonkey under CouchDB
- ๐ Fixed sortBy is unintentionally destructive
- Full Asian date number formats now accepted
- Array#map/min/max/most/least/groupBy/sortBy no longer errors on undefined, null, etc
- ๐ Fixed a bug with locking on Number#format when passing digits
Internal Changes
- โก๏ธ Optimized for Google closure compilers max compression level
- Minified script dropped about 5kb
- ๐ฏ Intelligently determining if cloned objects are extended
- transformArgument now just accepts not the arguments object
- ๐จ refactored asian digits to be globally replaced
- Date#toJSON and Date#toISOString now properly fall back to native methods
- โ Significantly wrote asynchronous function tests to be more reliable