Skip to content

Commit a74b2ba

Browse files
committed
Better support Node.js style module loaders.
1 parent 50372fa commit a74b2ba

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

js/md5.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
/*jslint bitwise: true */
21-
/*global unescape, define */
21+
/*global unescape, define, module */
2222

2323
(function ($) {
2424
'use strict';
@@ -268,6 +268,8 @@
268268
define(function () {
269269
return md5;
270270
});
271+
} else if (typeof module === 'object' && module.exports) {
272+
module.exports = md5;
271273
} else {
272274
$.md5 = md5;
273275
}

js/md5.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,5 @@
9696

9797
}(
9898
this.expect || require('expect.js'),
99-
this.md5 || require('../js/md5').md5
99+
this.md5 || require('../js/md5')
100100
));

0 commit comments

Comments
 (0)