mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
* [@kbn/interpreter] improve build/packaging (#26096) Summary of changes: - move all build artifacts under `target` directory - run babel and webpack in parallel - support optional watch and sourcemaps in build - expose /common /public /plugin /server sub-exports as index.js - avoid importing deeply from `@kbn/interpreter` - move a couple missed dependencies from x-pack to kibana - remove custom babel-register implementation * fix bad conflict resolution
27 lines
719 B
JavaScript
27 lines
719 B
JavaScript
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the Elastic License;
|
|
* you may not use this file except in compliance with the Elastic License.
|
|
*/
|
|
|
|
import { castProvider } from '@kbn/interpreter/common';
|
|
|
|
export const to = () => ({
|
|
name: 'to',
|
|
aliases: [],
|
|
help: 'Explicitly cast from one type to another',
|
|
context: {},
|
|
args: {
|
|
type: {
|
|
types: ['string'],
|
|
help: 'A known type',
|
|
aliases: ['_'],
|
|
multi: true,
|
|
},
|
|
},
|
|
fn: (context, args, { types }) => {
|
|
if (!args.type) throw new Error('Must specify a casting type');
|
|
|
|
return castProvider(types)(context, args.type);
|
|
},
|
|
});
|