File tree Expand file tree Collapse file tree 5 files changed +5
-25
lines changed
src/legacy/core_plugins/kibana/public/discover Expand file tree Collapse file tree 5 files changed +5
-25
lines changed Original file line number Diff line number Diff line change @@ -53,8 +53,6 @@ export { wrapInI18nContext } from 'ui/i18n';
5353import { search } from '../../../../../plugins/data/public' ;
5454export const { getRequestInspectorStats, getResponseInspectorStats, tabifyAggResponse } = search ;
5555// @ts -ignore
56- export { shortenDottedString } from '../../common/utils/shorten_dotted_string' ;
57- // @ts -ignore
5856export { intervalOptions } from 'ui/agg_types' ;
5957export { subscribeWithScope } from '../../../../../plugins/kibana_legacy/public' ;
6058// @ts -ignore
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ import classNames from 'classnames';
2121import { EuiFlexGroup , EuiFlexItem , EuiToolTip } from '@elastic/eui' ;
2222
2323import { FieldIcon , FieldIconProps } from '../../../../../../../../../plugins/kibana_react/public' ;
24- import { shortenDottedString } from '../../../../kibana_services ' ;
24+ import { shortenDottedString } from '../../../helpers ' ;
2525import { getFieldTypeName } from './field_type_name' ;
2626
2727// property field is provided at discover's field chooser
Original file line number Diff line number Diff line change 1616 * specific language governing permissions and limitations
1717 * under the License.
1818 */
19- import { IndexPattern , shortenDottedString } from '../../../../../kibana_services' ;
19+ import { IndexPattern } from '../../../../../kibana_services' ;
20+ import { shortenDottedString } from '../../../../helpers' ;
2021
2122export type SortOrder = [ string , string ] ;
2223export interface ColumnProps {
Original file line number Diff line number Diff line change 1717 * under the License.
1818 */
1919
20- import expect from '@kbn/expect' ;
21- import { shortenDottedString } from '../shorten_dotted_string' ;
22-
23- describe ( 'shortenDottedString' , ( ) => {
24- it ( 'Convert a dot.notated.string into a short string' , ( ) => {
25- expect ( shortenDottedString ( 'dot.notated.string' ) ) . to . equal ( 'd.n.string' ) ;
26- } ) ;
27-
28- it ( 'Ignores non-string values' , ( ) => {
29- expect ( shortenDottedString ( true ) ) . to . equal ( true ) ;
30- expect ( shortenDottedString ( 123 ) ) . to . equal ( 123 ) ;
31- const obj = { key : 'val' } ;
32- expect ( shortenDottedString ( obj ) ) . to . equal ( obj ) ;
33- } ) ;
34- } ) ;
20+ export { shortenDottedString } from './shorten_dotted_string' ;
Original file line number Diff line number Diff line change @@ -22,10 +22,5 @@ const DOT_PREFIX_RE = /(.).+?\./g;
2222/**
2323 * Convert a dot.notated.string into a short
2424 * version (d.n.string)
25- *
26- * @param {string } str - the long string to convert
27- * @return {string }
2825 */
29- export function shortenDottedString ( input ) {
30- return typeof input !== 'string' ? input : input . replace ( DOT_PREFIX_RE , '$1.' ) ;
31- }
26+ export const shortenDottedString = ( input : string ) => input . replace ( DOT_PREFIX_RE , '$1.' ) ;
You can’t perform that action at this time.
0 commit comments