aboutsummaryrefslogtreecommitdiffstats
path: root/src/umd.js
blob: bb8e3003d18cdfb84036e3755183eee68477356c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
(function(root, factory) {
  /* istanbul ignore next */
  if (typeof define === 'function' && define.amd) {
    define(function(){
      return factory(root, root.document)
    })
  } else if (typeof exports === 'object') {
    module.exports = root.document ? factory(root, root.document) : function(w){ return factory(w, w.document) }
  } else {
    root.SVG = factory(root, root.document)
  }
}(typeof window !== "undefined" ? window : this, function(window, document) {

// Check that our browser supports svg
var supported = !! document.createElementNS &&
  !! document.createElementNS('http://www.w3.org/2000/svg','svg').createSVGRect

// If we don't support svg, just exit without doing anything
if (!supported)
  return {supported: false}

// Otherwise, the library will be here
<%= contents %>

return SVG

}));