Changelog History
Page 3
-
v1.3.1 Changes
API Changes
- Matching by value in arrays is now opt-in and must meet certain requirements, namely being of class [object Object], and having
hasOwnProperty
. This will notably now exclude functions and host objects such as DOM elements. This means that such excluded objects will be matched by reference only. - π Fixed issue with Array.create not properly creating arrays #171
- Empty objects now match themselves in arrays #176
- Date#setWeekday now returns a timestamp for consistency with Date#setDay #181
- π Date#toUTC deprecated in favor of Date#utc and utc flag in Date#create.
- π Date#setUTC deprecated in favor of direct use of utc flag.
- π Date#setUTCWeek deprecated in favor of direct use of utc flag.
- π Date#getUTCWeek deprecated in favor of direct use of utc flag.
- π Date#setUTCWeekday deprecated in favor of direct use of utc flag.
- π― Date#clone now clones the utc flag of the date.
- π Fixed issue with DateRange causing an infinite loop when DST traverses back 1 hour.
- π Better date disambiguation for ambiguous dates ("Sunday", etc)
- π Various date parsing fixes.
- Timers set by delays are now exposed #170
- Function#debounce debounced function is now canceled instead of original.
- π¨ Internal refactoring of class check handling.
- Matching by value in arrays is now opt-in and must meet certain requirements, namely being of class [object Object], and having
-
v1.3 Changes
API Changes
- π¦ Sugar modules are now further split up and can easily be customized and repackaged. Aside from "core" there is the "es5" module that can be opted out of if <= IE8 support isn't an issue. DateRanges (below) are now their own module, as are inflections.
- Date locales are now a separate module, only English is included in the base "date" module.
- Enumerable methods are now available as class methods on Object, and instance methods on extended objects. This includes: map, any, all, none, count, sum, average, find, findAll, min, max, least, most, and reduce.
- β Added Object.size (also available to extended objects)
- 0οΈβ£ Array#min, Array#max, Array#least, and Array#most now return a single element by default with the option to return multiple elements.
- Object.equals now considers identical objects vs. extended objects to be the same
- π¨ Refactored Object.isEmpty to be an enumerable method in the Array module. This means that it will error on non-objects now.
- β Added "language" module.
- π String#normalize moved from Inflections to Language module
- π String#has[Script] moved from String to Language module
- π String#hankaku and String#zenkaku moved from String to Language module
- π String#hiragana and String#katakana moved from String to Language module
- π String#namespace moved from Inflections to String module
- String#parameterize now checks for normalize and also uses encodeURI for final output
π String#split patching for regexes is now removed from the String module and is on its own in /lib/extra. It can be dropped in anywhere after Sugar is loaded.
π Array#has is deprecated
Array#groupBy no longer returns extended objects
Array#groupBy no longer corrupts array length (Issue 142)
Enumerable methods now allow fuzzy matching of instances of classes (Issue 157)
All Math methods are now mapped onto Number and are accessible as instance methods
String#capitalize all will capitalize any letter after a letter that could not be capitalized.
String#insert, and Array#insert now treat negative indexes like String#slice
π Fixed issue with decodeBase64 shim (Issue 145)
π String#toDate is now deprecated.
π Date parsing formats are now scoped by locale. This means that if the current locale is set to English, only English formats will be parsed when Date#create does not specify a locale, even if a different locale was initialized previously. Numeric and common formats are available in all locales.
β Added output formats Date#long and Date#full which now included the time. Date#long (mm dd, yyyy hh:mm) is now the default for Date#format, and the previous default (no time) is now Date#short. Date#full includes milliseconds and weekday.
π Date format "just now" now supported
π Date#reset now supports resetting a unit based on a string.
Date#advance and other advance methods can now reset the time.
Date#advance now accepts string input like "4 days" (Issue 161)
π Date.past and Date.future added which allow date parsing that prefers the past or future when the specified date is ambiguous ("Sunday", etc.)
π Date parsing now allows time to be in front of the date string as well
π Fixed various issues with timezones, DST, and date parsing (Issue 146), (Issue 138)
β Added "in 3 days", etc. as a parsable format
β Added "the 2nd Tuesday of November", etc. as a parsable format
β Added more parsable formats with weekdays (such as "last monday", etc) in various locales
β Added time parsing in non-English date formats
Fully qualified ISO language codes will now match more generic codes. This means passing "it_IT" will correctly find "it" if the more specific locale is not available.
Unknown languages codes will now simply return an invalid date instead of throwing an error.
β Added support for full kanji numerals in date parsing
β Added support for time suffixes in Asian time strings (ζ etc)
β Added support for various relative formats in CKJ dates (ε ι±ζ°΄ζζ₯ etc)
π Fixed inconsistently not allowing spaces before am/pm (Issue 144)
β Added DateRange, accessed through Date.range
-
v1.2.5 Changes
API Changes
- π¨ String#truncate refactored to split words by default (standard behavior) allow splitting in various positions, and changing argument order.
- Object.isObject should be true for extended objects as well.
- Function#throttle added to take the place of Function#debounce with
false
as thewait
parameter. - π Date parsing support for hour/minute/second fractions (now take the place of milliseconds).
- π Date parsing support now sees commas in decimals.
- π Date parsing support for .NET dates.
-
v1.2.4 Changes
API Changes
- π Major performance improvement for Array#unique, Array#union, Array#intersect (now On vs. OnΒ²)
- Array#min, Array#max, Array#most, Array#least also benefit from this.
- Object.equal(s) is now egal (this should only matter for edge cases) like Underscore.
- π Object.merge will now work on non-objects as well.
- Custom formats in Date.addFormat will now override built-in formats.
- π Fix for Array#union incorrectly flattening arrays.
- π Fix for isObject not working across iframes.
- π Fix for String#chars incorrectly trimming.
- π Fix for String#each not matching all characters.
Internal Changes
- multiArgs now flatten is opt-in
-
v1.2.3 Changes
API Changes
- π String#compare, Number#compare, and Date#compare are deprecated.
- Array#sortBy now makes much more sensible sorting when sorting on strings.
- β Added Array.AlphanumericSortOrder
- β Added Array.AlphanumericSortIgnore
- β Added Array.AlphanumericSortIgnoreCase
- β Added Array.AlphanumericSortEquivalents
- π Object.merge defaults are now more sensible. shallow/deep is 3rd with shallow default and resolve is 4th
- β Added Number#duration to dates module.
- π Bugfix for leaking globals.
- π Bugfix for String#compact (Issue 115)
Internal Changes
- Cleanup for toISOString internal code.
-
v1.2.2 Changes
API Changes
- π Performance optimization for Object.merge and by extension Object.clone
- Object.extended now maintains its "Hash" constructor and checks against it when cloning.
- π Object.merge now will also clone dates and regexes as well.
- π Reset dates that will be set with UTC methods (fixes issue #98).
Internal Changes
- β Removed references to isDefined, isNull, and isObjectPrimitive
-
v1.2.1 Changes
API Changes
- β Added Object.has to fix issue #97. Stand-in for Object#hasOwnProperty.
- π Fixed issue with String#has not escaping regex tokens.
- 0οΈβ£ Date.setLocale can now overwrite a default locale object.
- Date locales can now add their own formats.
- π Fix for Ender, which was broken when modularized in 1.2.
- βͺ Workaround for Ender requiring externs.
Internal Changes
- Date optional tokens now start from {0}
- βͺ References to Object.extend and Object.restore now held and allowed to be restored later.
-
v1.2 Changes
API Changes
- π Allowed external libraries to extend natives through a common interface "extend".
- βͺ Renamed "sugar" to "restore" to restore Sugar methods on a given class.
- Extending Object.prototype functionality is now on "extend" instead.
- Split the date library into its own module that hooks into this new interface.
- β Added a new module: String inflections
- Object.keys now passes values as part of the callback like array methods.
- π Object.merge now merges undefined properties as well.
- Array#every now uses fuzzy object matching
- Array#some now uses fuzzy object matching
- Array#filter now uses fuzzy object matching
- Array#find now uses fuzzy object matching
- Array#findAll now uses fuzzy object matching
- Array#findIndex now uses fuzzy object matching
- π Array#remove now uses fuzzy object matching
- Array#none now uses fuzzy object matching
- Array#count now uses fuzzy object matching
- Array#exclude now uses fuzzy object matching
- π Array#clone is now no longer based off Array#concat, which will fail on sparse arrays in IE7.
- β Added Number#abbr
- β Added Number#metric
- β Added Number#bytes
- β Added Number#isInteger
- π Fixed issue with Number#ordinalize where 113 would be "113rd".
- String#each will now pass the match into the callback
- String#toDate will now check for Date.create before hooking into it.
- String#underscore will now check for acronyms if Inflectors module is present.
- String#camelize will now check for acronyms if Inflectors module is present.
- RegExp.escape will now perform a [toString] operation on non-strings (i.e. numbers, etc).
- Function#fill now uses internal Array#splice to fill in arguments.
- β Added support for JSON date format Date(xxxxxxxxxx).
- π Fixed issues with Date#getWeek.
- π Fixed issues with traversing months before January.
- String#titleize added to inflections module.
Internal Changes
- Reworked "multiMatch" to recursively traverse object structures.
- π mergeObject now merges undefined properties as well
- Created method arrayIntersect to handle both Array#intersect and Array#subtract
- Array#intersect and Array#subtract will not allow fuzzy object matching
- Array#indexOf and Array#lastIndexOf polyfills now work off arrayIndexOf
- β Added internal support for other dates that use timestamps.
- π Reworked adding of Date#toISOString and Date#toJSON support.
-
v1.1.3 Changes
API Changes
- π Fixed issue with Object.isEmpty where strings with length > 0 will return true.
Internal Changes
- β‘οΈ Updated Array#sortBy to use .compare method when available.
-
v1.1.2 Changes
API Changes
- β Added Array#findIndex.
- β Added Array#sample.
- β Added String#compare.
- β Added Number#compare.
- β Added Date#compare.
- π Fixed issue with floats not properly being recognized in the query string.
- π Fixed issue with Object.isEmpty on non-object types and null.
- π Fixed issue with arrayEach not allowing negative start indexes.
- π Fixed issue with Array#reduce not recognizing 0 as a starting value.
- π Fixed issue with Array#add not allowing negative indexes.
- π Fixed issue with Number.random not recognizing upper limit of 0.
- π Fixed issue with String#dasherize not working on single camel cased letters.
- π Fixed issue with String#assign not working on an empty string or other falsy value.
- π Fixed issues with French and German date months not being correct.
- π Fixed Function#after not calling the method immediately when num is 0.
Internal Changes
- π¨ Refactored Array#reduce and Array#reduceRight to use the same internal method.
- π¨ Refactored String#camelize to be smaller.
- π¨ Refactored checkMonthTraversal to be more robust in a variety of situations.