Skip to content

Commit eeb4b46

Browse files
committed
[ui/public/utils] Delete unused base_object & find_by_param (elastic#52500)
Closes elastic#51854
1 parent 666817e commit eeb4b46

File tree

7 files changed

+194
-321
lines changed

7 files changed

+194
-321
lines changed

src/legacy/ui/public/state_management/state.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,27 @@ export function StateProvider(Private, $rootScope, $location, stateManagementCon
316316
return this._urlParam;
317317
};
318318

319+
/**
320+
* Returns an object with each property name and value corresponding to the entries in this collection
321+
* excluding fields started from '$', '_' and all methods
322+
*
323+
* @return {object}
324+
*/
325+
State.prototype.toObject = function () {
326+
return _.omit(this, (value, key) => {
327+
return key.charAt(0) === '$' || key.charAt(0) === '_' || _.isFunction(value);
328+
});
329+
};
330+
331+
/** Alias for method 'toObject'
332+
*
333+
* @obsolete Please use 'toObject' method instead
334+
* @return {object}
335+
*/
336+
State.prototype.toJSON = function () {
337+
return this.toObject();
338+
};
339+
319340
return State;
320341

321342
}

src/legacy/ui/public/utils/__tests__/base_object.js

Lines changed: 0 additions & 57 deletions
This file was deleted.

src/legacy/ui/public/utils/__tests__/simple_emitter.js

Lines changed: 0 additions & 175 deletions
This file was deleted.

src/legacy/ui/public/utils/base_object.ts

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/legacy/ui/public/utils/find_by_param.ts

Lines changed: 0 additions & 38 deletions
This file was deleted.

src/legacy/ui/public/utils/simple_emitter.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,13 @@
1818
*/
1919

2020
import _ from 'lodash';
21-
import { BaseObject } from './base_object';
22-
import { createLegacyClass } from './legacy_class';
2321

2422
/**
2523
* Simple event emitter class used in the vislib. Calls
2624
* handlers synchronously and implements a chainable api
2725
*
2826
* @class
2927
*/
30-
createLegacyClass(SimpleEmitter).inherits(BaseObject);
3128
export function SimpleEmitter() {
3229
this._listeners = {};
3330
}
@@ -134,4 +131,3 @@ SimpleEmitter.prototype.listenerCount = function (name) {
134131
return count + _.size(handlers);
135132
}, 0);
136133
};
137-

0 commit comments

Comments
 (0)