Sugar v0.9.5 Release Notes

  • API Changes

    • .sugar method added to all classes to reinstate Sugar methods conditionally.
    • 0๏ธโƒฃ Object.clone is now shallow by default, with an option for deep cloning
    • ๐Ÿ”€ Object.merge will now ignore non-objects
    • Object.fromQueryString now takes the place of String#toObject.
    • ๐Ÿ“œ Nested object/array param parsing now possible with Object.fromQueryString.
    • ๐Ÿšš Array#remove now accepts unlimited parameters
    • Array#exclude now accepts unlimited parameters
    • Array#union now accepts unlimited parameters
    • Array#subtract now accepts unlimited parameters
    • Array#intersect now accepts unlimited parameters
    • ๐Ÿ—„ Array#split deprecated
    • ๐Ÿšš Array#compact no longer removes functions (bug)
    • Array#compact now accepts flag to compact all falsy values
    • Number#upto and Number#downto now accept a third parameter to traverse in multiples of > 1
    • Number#pad now accepts a third parameter that is the base of the number
    • 0๏ธโƒฃ Number#hex now accepts a parameter to pad the resulting string with a default of 1
    • String#escapeHTML added
    • String#truncate added. Will truncate a string without breaking words.
    • ๐Ÿ”จ String#toObject now refactored to Object.fromQueryString
    • ๐Ÿ”จ Function.lazy refactored to Function#lazy
    • Function#lazy functions can now be cancelled via Function#cancel
    • ๐Ÿ—„ Function#defer deprecated -> use Function#delay instead
    • Function#debounce added
    • Function#after added
    • Function#once added

    Internal Changes

    • ๐Ÿšš extendWithNativeCondition removed. Functionality now contained in extend
    • ๐Ÿšš shuffled and removed some dependencies to make it easier to extract the date module
    • more robust equality comparison:
    • multiArgs added to collect arguments
    • array indexes now checked with hasProperty instead of hasOwnProperty
    • ๐Ÿ— object builders are now going through extend so they can store their references
    • ๐Ÿ”จ Object.clone refactored to use multiArgs
    • Object.isEmpty now returns false if passed argument itself is falsy
    • ๐Ÿ”จ String#stripTags refactored to use multiArgs
    • ๐Ÿ”จ String#removeTags refactored to use multiArgs -- "null" now taken into consideration for objects -- object key length compared -- strict equality matches in multiMatch