UNPKG

1.21 kBJavaScriptView Raw
1/*
2 Expose Internal API
3
4 把 Expose 部分放在代码头部非常直观 <https://github.com/kennethcachia/Background-Check/blob/master/background-check.js>
5*/
6Mock.Util = Util
7Mock.Random = Random
8Mock.heredoc = Util.heredoc
9
10/*
11 For Module Loader
12*/
13if (typeof module === 'object' && module.exports) {
14 // CommonJS
15 module.exports = Mock
16
17} else if (typeof define === "function" && define.amd) {
18 // AMD modules
19 define(function() {
20 return Mock
21 })
22
23} else if (typeof define === "function" && define.cmd) {
24 // CMD modules
25 define(function() {
26 return Mock
27 })
28
29}
30// else {
31// other, i.e. browser
32this.Mock = Mock
33this.Random = Random
34// }
35
36// For KISSY
37if (typeof KISSY != 'undefined') {
38 /*
39 KISSY.use('components/mock/index', function(S, Mock) {
40 console.log(Mock.mock)
41 })
42 */
43 Util.each([
44 'mock', 'components/mock/', 'mock/dist/mock',
45 'gallery/Mock/0.1.1/',
46 'gallery/Mock/0.1.2/',
47 'gallery/Mock/0.1.3/',
48 ], function register(name) {
49 KISSY.add(name, function(S) {
50 Mock.mockjax(S)
51 return Mock
52 }, {
53 requires: ['ajax']
54 })
55 })
56}
\No newline at end of file