mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[lodash] switch to bonafide _.wrap
This commit is contained in:
parent
f22276ae35
commit
8f6165a15c
2 changed files with 6 additions and 15 deletions
|
@ -20,15 +20,13 @@ define(function (require) {
|
|||
function CustomAngularConnector(host, config) {
|
||||
CustomAngularConnector.Super.call(this, host, config);
|
||||
|
||||
var originalRequest = this.request;
|
||||
this.request = function (params) {
|
||||
this.request = _.wrap(this.request, function (request, params) {
|
||||
if (String(params.method).toUpperCase() === 'GET') {
|
||||
params.query = params.query || {};
|
||||
params.query._ = Date.now();
|
||||
params.query = _.defaults({ _: Date.now() }, params.query);
|
||||
}
|
||||
|
||||
return originalRequest.apply(this, arguments);
|
||||
};
|
||||
return request.apply(this, arguments);
|
||||
});
|
||||
}
|
||||
|
||||
config.connectionClass = CustomAngularConnector;
|
||||
|
|
|
@ -14,15 +14,8 @@
|
|||
var COVERAGE = window.COVERAGE = !!(/coverage/i.test(window.location.search));
|
||||
var DISABLE_RESIZE_CHECKER = window.DISABLE_RESIZE_CHECKER = true;
|
||||
|
||||
function wrap(obj, method, fn) {
|
||||
var orig = obj[method];
|
||||
return obj[method] = function methodProxy() {
|
||||
return fn.apply(this, [orig].concat([].slice.call(arguments)));
|
||||
};
|
||||
}
|
||||
|
||||
wrap(mocha, 'ui', function (orig, ui) {
|
||||
var ret = orig.call(this, ui);
|
||||
mocha.ui = _.wrap(mocha.ui, function (mochaUi, ui) {
|
||||
var ret = mochaUi.call(this, ui);
|
||||
|
||||
var _desc = window.describe;
|
||||
window.describe = wrap(window, 'describe', unwindDescribeArrays);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue