MCPcopy
hub / github.com/vitejs/vite / mergeWithDefaults

Function mergeWithDefaults

packages/vite/src/node/utils.ts:1234–1241  ·  view source on GitHub ↗
(defaults: D, values: V)

Source from the content-addressed store, hash-verified

1232const environmentPathRE = /^environments\.[^.]+$/
1233
1234export function mergeWithDefaults<
1235 D extends Record<string, any>,
1236 V extends Record<string, any>,
1237>(defaults: D, values: V): MergeWithDefaultsResult<DeepWritable<D>, V> {
1238 // NOTE: we need to clone the value here to avoid mutating the defaults
1239 const clonedDefaults = deepClone(defaults)
1240 return mergeWithDefaultsRecursively(clonedDefaults, values)
1241}
1242
1243const runtimeDeprecatedPath = new Set(['optimizeDeps', 'ssr.optimizeDeps'])
1244const rollupOptionsDeprecationCall = (() => {

Callers 11

resolveConfigFunction · 0.90
resolveBuilderOptionsFunction · 0.90
utils.tsFile · 0.90
resolveSSROptionsFunction · 0.90
resolveServerOptionsFunction · 0.90
resolveCSSOptionsFunction · 0.90
utils.spec.tsFile · 0.90

Calls 2

deepCloneFunction · 0.85

Tested by

no test coverage detected