Skip to content

Commit 367d0b6

Browse files
committed
Add UMD wrapper
1 parent 423abb5 commit 367d0b6

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

index.js

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,31 @@ Copyrights licensed under the New BSD License.
44
See the accompanying LICENSE file for terms.
55
*/
66

7+
(function (root, factory) {
8+
'use strict';
9+
10+
// UMD
11+
/* istanbul ignore next */
12+
if (typeof define === 'function' && define.amd) {
13+
define(factory);
14+
} else if (typeof exports === 'object') {
15+
module.exports = factory();
16+
} else if (typeof YUI !== 'undefined' && YUI.add) {
17+
YUI.add('css-mediaquery', factory, '0.1.2', {es: true});
18+
} else {
19+
root.mediaQuery = factory();
20+
}
21+
22+
})(typeof global !== 'undefined' ? global : this, function () {
23+
24+
// -----------------------------------------------------------------------------
25+
726
'use strict';
827

9-
exports.match = matchQuery;
10-
exports.parse = parseQuery;
28+
var exports = {
29+
match: matchQuery,
30+
parse: parseQuery
31+
};
1132

1233
// -----------------------------------------------------------------------------
1334

@@ -178,3 +199,7 @@ function toPx(length) {
178199
default : return value;
179200
}
180201
}
202+
203+
return exports;
204+
205+
});

0 commit comments

Comments
 (0)