MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / getRelativeTimeFormat

Function getRelativeTimeFormat

source code/utils/intl.ts:58–69  ·  view source on GitHub ↗
(
  style: 'long' | 'short' | 'narrow',
  numeric: 'always' | 'auto',
)

Source from the content-addressed store, hash-verified

56const rtfCache = new Map<string, Intl.RelativeTimeFormat>()
57
58export function getRelativeTimeFormat(
59 style: 'long' | 'short' | 'narrow',
60 numeric: 'always' | 'auto',
61): Intl.RelativeTimeFormat {
62 const key = `${style}:${numeric}`
63 let rtf = rtfCache.get(key)
64 if (!rtf) {
65 rtf = new Intl.RelativeTimeFormat('en', { style, numeric })
66 rtfCache.set(key, rtf)
67 }
68 return rtf
69}
70
71// Timezone is constant for the process lifetime
72let cachedTimeZone: string | null = null

Callers 1

formatRelativeTimeFunction · 0.85

Calls 2

setMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected