diff --git a/lib/underscore.string.js b/lib/underscore.string.js index b1459ab2..aaa244ff 100644 --- a/lib/underscore.string.js +++ b/lib/underscore.string.js @@ -591,25 +591,23 @@ _s.contains = _s.include; _s.q = _s.quote; + // Exporting + // CommonJS module is defined if (typeof exports !== 'undefined') { - if (typeof module !== 'undefined' && module.exports) { - // Export module + if (typeof module !== 'undefined' && module.exports) module.exports = _s; - } - exports._s = _s; - } else if (typeof define === 'function' && define.amd) { - // Register as a named module with AMD. - define('underscore.string', [], function() { - return _s; - }); - - } else { - // Integrate with Underscore.js if defined - // or create our own underscore object. - root._ = root._ || {}; - root._.string = root._.str = _s; + exports._s = _s; } + // Register as a named module with AMD. + if (typeof define === 'function' && define.amd) + define('underscore.string', [], function(){ return _s; }); + + + // Integrate with Underscore.js if defined + // or create our own underscore object. + root._ = root._ || {}; + root._.string = root._.str = _s; }(this, String);