MCPcopy
hub / github.com/vuejs/core / normalizePropsOrEmits

Function normalizePropsOrEmits

packages/runtime-core/src/apiSetupHelpers.ts:434–443  ·  view source on GitHub ↗
(
  props: ComponentPropsOptions | EmitsOptions,
)

Source from the content-addressed store, hash-verified

432 * @internal
433 */
434export function normalizePropsOrEmits(
435 props: ComponentPropsOptions | EmitsOptions,
436): ComponentObjectPropsOptions | ObjectEmitsOptions {
437 return isArray(props)
438 ? props.reduce(
439 (normalized, p) => ((normalized[p] = null), normalized),
440 {} as ComponentObjectPropsOptions | ObjectEmitsOptions,
441 )
442 : props
443}
444
445/**
446 * Runtime helper for merging default declarations. Imported by compiled code

Callers 3

mergeEmitsOrPropsOptionsFunction · 0.90
mergeDefaultsFunction · 0.85
mergeModelsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected