Skip to content

Commit

Permalink
Use this.namespace-style global.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdaines committed Oct 27, 2015
1 parent 62385c2 commit 38bee06
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions src/post.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var graphviz;

return function(src) {
function Viz(src) {
var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
var format = options.format === undefined ? "svg" : options.format;
var engine = options.engine === undefined ? "dot" : options.engine;
Expand All @@ -21,8 +21,11 @@

return resultString;
}
})();

if (typeof module === "object" && module.exports) {
module.exports = Viz;
}

if (typeof module === "object" && module.exports) {
module.exports = Viz;
} else {
global.Viz = Viz;
}

})(this);
2 changes: 1 addition & 1 deletion src/pre.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
var Viz = (function() {
(function(global) {

0 comments on commit 38bee06

Please sign in to comment.