• Aug 25, 2013


    String#repeat to its own block
    Former-commit-id: fcb7858e3e489dc9027c235af30a89261e863f5a [formerly ccdf6c6622ea7720154237f34a030cc471d7b339]
    Former-commit-id: dbdbb355831485e7599884202aac656694681970

v1.3.9 - jQuery 1.9 Fix and Object.toQueryString

@andrewplummer andrewplummer released this Jun 20, 2013 · 2943 commits to master since this release

The most major point of this release was fixing jQuery 1.9, which broke in one area when Sugar was included in the page. The cause was complex, on jQuery’s side there was an issue that I submitted a pull request for, however the most direct culprit was String#namespace which is a method that never really fit into the library anyway. As a result I have removed this method from String entirely. At the moment I’m not sure if it will be re-added as it feels better for another lib.


The inverse to Object.fromQueryString, this method will take an object and turn it into a query string for use in a url. In addition to the main method it is also mapped onto extended objects, making it even easier. Finally, a namespace can be added to scope all parameters by the given namespace.

var o1 = { foo: 'bar' };
var o2 = { foo: [1,2,3] };
Object.toQueryString(o1)        // 'foo=bar'
Object.toQueryString(o2)        // 'foo[0]=1&foo[1]=2&foo[2]=3'
Object.toQueryString(o2, 'bar') // 'bar[foo][0]=1&bar[foo][1]=2&foo[2]=3'

var o1 = Object.extended({ foo: 'bar' });
var o2 = Object.extended({ foo: [1,2,3] });

o1.toQueryString()      // 'foo=bar'
o2.toQueryString()      // 'foo[0]=1&foo[1]=2&foo[2]=3'
o2.toQueryString('bar') // 'bar[foo][0]=1&bar[foo][1]=2&foo[2]=3'

Other Minor Fixes

Fixed issue with timezone offsets like “-0330”.
Fixed issue with date comparison methods like isToday not working when another locale is set.