MCPcopy Create free account
hub / github.com/formatjs/formatjs / mergeConfig

Function mergeConfig

packages/intl-messageformat/core.ts:26–41  ·  view source on GitHub ↗
(c1: Record<string, object>, c2?: Record<string, object>)

Source from the content-addressed store, hash-verified

24// -- MessageFormat --------------------------------------------------------
25
26function mergeConfig(c1: Record<string, object>, c2?: Record<string, object>) {
27 if (!c2) {
28 return c1
29 }
30 return {
31 ...c1,
32 ...c2,
33 ...Object.keys(c1).reduce((all: Record<string, object>, k) => {
34 all[k] = {
35 ...c1[k],
36 ...c2[k],
37 }
38 return all
39 }, {}),
40 }
41}
42
43function mergeConfigs(
44 defaultConfig: Formats,

Callers 1

mergeConfigsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected