File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { FluentResource } from "./resource.js";
44import { FluentValue , FluentNone , FluentFunction } from "./types.js" ;
55import { Message , Term , Pattern } from "./ast.js" ;
66import { NUMBER , DATETIME } from "./builtins.js" ;
7- import { getMemoizerForLocale } from "./memoizer.js" ;
7+ import { getMemoizerForLocale , IntlCache } from "./memoizer.js" ;
88
99export type TextTransform = ( text : string ) => string ;
1010
@@ -23,12 +23,7 @@ export class FluentBundle {
2323 public _functions : Record < string , FluentFunction > ;
2424 public _useIsolating : boolean ;
2525 public _transform : TextTransform ;
26- public _intls = new WeakMap <
27- | typeof Intl . NumberFormat
28- | typeof Intl . DateTimeFormat
29- | typeof Intl . PluralRules ,
30- Record < string , Intl . NumberFormat | Intl . DateTimeFormat | Intl . PluralRules >
31- > ( ) ;
26+ public _intls : IntlCache ;
3227
3328 /**
3429 * Create an instance of `FluentBundle`.
Original file line number Diff line number Diff line change 1- type IntlCache = WeakMap <
1+ export type IntlCache = Map <
22 | typeof Intl . NumberFormat
33 | typeof Intl . DateTimeFormat
44 | typeof Intl . PluralRules ,
@@ -11,7 +11,7 @@ export function getMemoizerForLocale(locales: string | string[]): IntlCache {
1111 const stringLocale = Array . isArray ( locales ) ? locales . join ( " " ) : locales ;
1212 let memoizer = cache . get ( stringLocale ) ;
1313 if ( memoizer === undefined ) {
14- memoizer = new WeakMap ( ) ;
14+ memoizer = new Map ( ) ;
1515 cache . set ( stringLocale , memoizer ) ;
1616 }
1717
You can’t perform that action at this time.
0 commit comments