Skip to content

Commit c58e3b1

Browse files
authored
Merge pull request #55 from gaohuazuo/master
Add AMD loader support
2 parents fd55c21 + 8731b8b commit c58e3b1

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

diffDOM.js

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
(function() {
1+
(function(root, factory) {
2+
if (typeof exports !== 'undefined') {
3+
if (typeof module !== 'undefined' && module.exports) {
4+
exports = module.exports = factory();
5+
} else {
6+
exports.diffDOM = factory();
7+
}
8+
} else if (typeof define === 'function') {
9+
// AMD loader
10+
define(factory);
11+
} else {
12+
// `window` in the browser, or `exports` on the server
13+
root.diffDOM = factory();
14+
}
15+
})(this, function() {
216
"use strict";
317

418
var diffcount;
@@ -1358,14 +1372,5 @@
13581372
}
13591373
};
13601374

1361-
if (typeof exports !== 'undefined') {
1362-
if (typeof module !== 'undefined' && module.exports) {
1363-
exports = module.exports = diffDOM;
1364-
}
1365-
exports.diffDOM = diffDOM;
1366-
} else {
1367-
// `window` in the browser, or `exports` on the server
1368-
this.diffDOM = diffDOM;
1369-
}
1370-
1371-
}.call(this));
1375+
return diffDOM;
1376+
});

0 commit comments

Comments
 (0)