Function
createFastMemoizeCache
(
store: Record<string, V | undefined>
)
Source from the content-addressed store, hash-verified
| 3 | const cache: Record<string, Intl.DateTimeFormat> = {} |
| 4 | |
| 5 | function createFastMemoizeCache<V>( |
| 6 | store: Record<string, V | undefined> |
| 7 | ): Cache<string, V> { |
| 8 | return { |
| 9 | create() { |
| 10 | return { |
| 11 | get(key) { |
| 12 | return store[key] |
| 13 | }, |
| 14 | set(key, value) { |
| 15 | store[key] = value |
| 16 | }, |
| 17 | } |
| 18 | }, |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | type DTFParameters = ConstructorParameters<typeof Intl.DateTimeFormat> |
| 23 | |
Tested by
no test coverage detected