-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
misc: update structure & template render info
- Loading branch information
1 parent
e8c5148
commit 53af0d8
Showing
54 changed files
with
1,749 additions
and
664 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
'use strict'; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.Local = exports.Proxy = undefined; | ||
|
||
var _proxy = require('./proxy'); | ||
|
||
var _proxy2 = _interopRequireDefault(_proxy); | ||
|
||
var _local = require('./local'); | ||
|
||
var _local2 = _interopRequireDefault(_local); | ||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
|
||
exports.Proxy = _proxy2.default; | ||
exports.Local = _local2.default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
|
||
'use strict'; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
|
||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
|
||
var _data = require('../../data'); | ||
|
||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } | ||
|
||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
|
||
var LocalMock = function () { | ||
function LocalMock() { | ||
_classCallCheck(this, LocalMock); | ||
} | ||
|
||
_createClass(LocalMock, [{ | ||
key: 'getMocker', | ||
value: function getMocker() { | ||
var _this = this; | ||
|
||
var mock = function () { | ||
var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(ctx, next) { | ||
return regeneratorRuntime.wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
_context.prev = 0; | ||
|
||
ctx.body = new _data.AsyncData(ctx).getData(); | ||
ctx.type = 'json'; | ||
_context.next = 8; | ||
break; | ||
|
||
case 5: | ||
_context.prev = 5; | ||
_context.t0 = _context['catch'](0); | ||
return _context.abrupt('return', next()); | ||
|
||
case 8: | ||
case 'end': | ||
return _context.stop(); | ||
} | ||
} | ||
}, _callee, _this, [[0, 5]]); | ||
})); | ||
|
||
return function mock(_x, _x2) { | ||
return _ref.apply(this, arguments); | ||
}; | ||
}(); | ||
return mock; | ||
} | ||
}]); | ||
|
||
return LocalMock; | ||
}(); | ||
|
||
exports.default = LocalMock; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
|
||
'use strict'; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
|
||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
|
||
var _proxy = require('./proxy'); | ||
|
||
var _proxy2 = _interopRequireDefault(_proxy); | ||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
|
||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
|
||
var _class = function () { | ||
function _class() { | ||
_classCallCheck(this, _class); | ||
|
||
this.config = fozy.__config.mock.proxy; | ||
this.headers = { | ||
'accept-encoding': 'gzip;q=0,deflate,sdch,br' | ||
}; | ||
} | ||
|
||
_createClass(_class, [{ | ||
key: 'getMocker', | ||
value: function getMocker() { | ||
var config = this.config; | ||
|
||
var option = { | ||
target: config.target, | ||
headers: this.headers | ||
}; | ||
|
||
if (config.host) { | ||
option.host = config.host; | ||
} | ||
return (0, _proxy2.default)(option); | ||
} | ||
}]); | ||
|
||
return _class; | ||
}(); | ||
|
||
exports.default = _class; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
'use strict'; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.GlobalSyncData = exports.SyncData = exports.AsyncData = exports.LocalData = undefined; | ||
|
||
var _local_data = require('./local_data'); | ||
|
||
var _local_data2 = _interopRequireDefault(_local_data); | ||
|
||
var _async_data = require('./async_data'); | ||
|
||
var _async_data2 = _interopRequireDefault(_async_data); | ||
|
||
var _sync_data = require('./sync_data'); | ||
|
||
var _sync_data2 = _interopRequireDefault(_sync_data); | ||
|
||
var _global_sync_data = require('./global_sync_data'); | ||
|
||
var _global_sync_data2 = _interopRequireDefault(_global_sync_data); | ||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
|
||
exports.LocalData = _local_data2.default; | ||
exports.AsyncData = _async_data2.default; | ||
exports.SyncData = _sync_data2.default; | ||
exports.GlobalSyncData = _global_sync_data2.default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.