diff --git a/wildstring.js b/wildstring.js index 7479270..466c75d 100644 --- a/wildstring.js +++ b/wildstring.js @@ -1,14 +1,17 @@ 'use strict'; -(function (root, definition) { +var wildstring = (function (name, definition) { if (typeof(module) !== 'undefined') { module.exports = definition(); } else if (typeof(define) === 'function' && typeof(define.amd) === 'object') { define(definition); } + else if (typeof(this) !== 'undefined') { + this[name] = definition(); + } else { - this['wildstring'] = definition(); + return definition(); } }('wildstring', function () {