Skip to content

Commit

Permalink
Add UMD wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Apr 1, 2015
1 parent 4d3d281 commit 2569618
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules
build
components
.idea/
*.iml
23 changes: 16 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,20 @@
* Licensed under the MIT License.
*/
/*jshint indent:2, laxcomma:true*/
;(function (undefined) {
;(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory();
} else {
// Browser globals (root is window)
root.DeepDiff = factory();
}
}(this, function (undefined) {
"use strict";

var $scope
Expand Down Expand Up @@ -339,9 +352,5 @@
}
});

if (typeof module !== 'undefined' && module && typeof exports === 'object' && exports && module.exports === exports) {
module.exports = accumulateDiff; // nodejs
} else {
$scope.DeepDiff = accumulateDiff; // other... browser?
}
}());
return accumulateDiff;
}));

0 comments on commit 2569618

Please sign in to comment.