Skip to content

Commit

Permalink
修复root.DeepDiff undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
snice authored May 15, 2018
1 parent 31d5e52 commit ed8452f
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) { // eslint-disable-line no-undef
define([], factory);// eslint-disable-line no-undef
} else if (typeof module === 'object' && module.exports) {
module.exports = factory();
;(function(root, factory) {
var deepDiff = factory(root);
if (typeof define === 'function' && define.amd) {
// AMD
define('DeepDiff', function() {
return deepDiff;
});
} else if (typeof exports === 'object') {
// Node.js
module.exports = deepDiff;
} else {
root.returnExports = factory();
// Browser globals
var _deepdiff = root.DeepDiff;
deepDiff.noConflict = function() {
if (root.DeepDiff === deepDiff) {
root.DeepDiff = _deepdiff;
}
return deepDiff;
};
root.DeepDiff = deepDiff;
}
// eslint-disable-next-line no-undef
}(typeof self !== 'undefined' ? self : this, function () {
var root = this;
}(this, function(root) {
var $conflict = root.DeepDiff;

var validKinds = ['N', 'E', 'A', 'D'];
Expand Down

0 comments on commit ed8452f

Please sign in to comment.