MCPcopy Index your code
hub / github.com/formatjs/formatjs / deepMergeOptions

Function deepMergeOptions

packages/intl/message.ts:41–53  ·  view source on GitHub ↗
(
  opts1: Record<string, Intl.DateTimeFormatOptions>,
  opts2: Record<string, Intl.DateTimeFormatOptions>
)

Source from the content-addressed store, hash-verified

39}
40
41function deepMergeOptions(
42 opts1: Record<string, Intl.DateTimeFormatOptions>,
43 opts2: Record<string, Intl.DateTimeFormatOptions>
44): Record<string, Intl.DateTimeFormatOptions> {
45 const keys = Object.keys({...opts1, ...opts2})
46 return keys.reduce((all: Record<string, Intl.DateTimeFormatOptions>, k) => {
47 all[k] = {
48 ...opts1[k],
49 ...opts2[k],
50 }
51 return all
52 }, {})
53}
54
55function deepMergeFormatsAndSetTimeZone(
56 f1: CustomFormats,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected