Skip to content

Commit

Permalink
Export method using UMD
Browse files Browse the repository at this point in the history
  • Loading branch information
litenjacob committed May 3, 2015
1 parent e8e9beb commit 00179c6
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/findAndReplaceDOMText.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,18 @@
* and replaces each match (or node-separated portions of the match)
* in the specified element.
*/
window.findAndReplaceDOMText = (function() {
(function (root, factory) {
if (typeof module === 'object' && module.exports) {
// Node/CommonJS
module.exports = factory();
} else if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(factory);
} else {
// Browser globals
root.findAndReplaceDOMText = factory();
}
}(this, function factory() {

var PORTION_MODE_RETAIN = 'retain';
var PORTION_MODE_FIRST = 'first';
Expand Down Expand Up @@ -617,4 +628,4 @@ window.findAndReplaceDOMText = (function() {

return exposed;

}());
}));

0 comments on commit 00179c6

Please sign in to comment.