From: Evan You Date: Fri, 1 May 2020 13:19:30 +0000 (-0400) Subject: types: fix internal exports from @vue/shared X-Git-Tag: v3.0.0-beta.6~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=127e96a993bebdb99f0012020b88d99e4ae31df7;p=thirdparty%2Fvuejs%2Fcore.git types: fix internal exports from @vue/shared --- diff --git a/packages/runtime-core/src/index.ts b/packages/runtime-core/src/index.ts index 85efb5b0f9..d8bf480bff 100644 --- a/packages/runtime-core/src/index.ts +++ b/packages/runtime-core/src/index.ts @@ -207,7 +207,20 @@ export { createCommentVNode, createStaticVNode } from './vnode' -export { toDisplayString, camelize } from '@vue/shared' + +// a bit of ceremony to mark these internal only here because we need to include +// them in @vue/shared's typings +import { toDisplayString, camelize } from '@vue/shared' +/** + * @internal + */ +const _toDisplayString = toDisplayString +/** + * @internal + */ +const _camelize = camelize +export { _toDisplayString as toDisplayString, _camelize as camelize } + // For integration with runtime compiler export { registerRuntimeCompiler } from './component' // For test-utils diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts index 65197c851b..8274c10de8 100644 --- a/packages/shared/src/index.ts +++ b/packages/shared/src/index.ts @@ -89,9 +89,6 @@ const cacheStringFunction = string>(fn: T): T => { } const camelizeRE = /-(\w)/g -/** - * @internal - */ export const camelize = cacheStringFunction( (str: string): string => { return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : '')) @@ -115,10 +112,7 @@ export const capitalize = cacheStringFunction( export const hasChanged = (value: any, oldValue: any): boolean => value !== oldValue && (value === value || oldValue === oldValue) -/** - * For converting {{ interpolation }} values to displayed strings. - * @internal - */ +// For converting {{ interpolation }} values to displayed strings. export const toDisplayString = (val: unknown): string => { return val == null ? ''