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

Function normalizeInject

packages/runtime-core/src/componentOptions.ts:1067–1078  ·  view source on GitHub ↗
(
  raw: ComponentInjectOptions | undefined,
)

Source from the content-addressed store, hash-verified

1065}
1066
1067function normalizeInject(
1068 raw: ComponentInjectOptions | undefined,
1069): ObjectInjectOptions | undefined {
1070 if (isArray(raw)) {
1071 const res: ObjectInjectOptions = {}
1072 for (let i = 0; i < raw.length; i++) {
1073 res[raw[i]] = raw[i]
1074 }
1075 return res
1076 }
1077 return raw
1078}
1079
1080function mergeAsArray<T = Function>(to: T[] | T | undefined, from: T | T[]) {
1081 return to ? [...new Set([].concat(to as any, from as any))] : from

Callers 2

resolveInjectionsFunction · 0.85
mergeInjectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected