Skip to content

Commit

Permalink
Add AMD support
Browse files Browse the repository at this point in the history
  • Loading branch information
natlibfi-arlehiko committed Mar 25, 2016
1 parent 28dcc21 commit 01b994a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* global define */
(function (global, module) { // Browser compatibility
var simple = module.exports
var mocks = []
Expand Down Expand Up @@ -208,7 +209,11 @@
var funcClass = '[object Function]'

// Browser compatibility
if (typeof window !== 'undefined') {
if (typeof define === 'function' && define.amd) {
define(function () {
return simple
})
} else if (typeof window !== 'undefined') {
window.simple = simple
}

Expand Down

0 comments on commit 01b994a

Please sign in to comment.