Skip to content
Browse files

Merge pull request #1 from dluxemburg/master

Change export for compatibility across CommonJS implementations
  • Loading branch information...
2 parents 5d74493 + 342307e commit 5f9c44ea938c195774451de0cfcbdc9a7fb04555 @Flamefork committed Nov 8, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/underscore.date.js
View
8 lib/underscore.date.js
@@ -304,9 +304,13 @@
_d.distanceOfTimeInWords.i18n.en = _d.distanceOfTimeInWords.i18n._default;
// CommonJS module is defined
- if (typeof window === 'undefined' && typeof module !== 'undefined') {
+ if (typeof exports !== 'undefined') {
+
// Export module
- module.exports = _d;
+ if (typeof module !== 'undefined' && module.exports) {
+ exports = module.exports = _d;
+ }
+ exports._d = _d;
// Integrate with Underscore.js
} else if (typeof root._ !== 'undefined') {

0 comments on commit 5f9c44e

Please sign in to comment.
Something went wrong with that request. Please try again.