File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
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,7 +23,7 @@ export class FluentBundle {
2323 public _functions : Record < string , FluentFunction > ;
2424 public _useIsolating : boolean ;
2525 public _transform : TextTransform ;
26- public _intls : WeakMap < object , Record < string , object > > ;
26+ public _intls : IntlCache ;
2727
2828 /**
2929 * Create an instance of `FluentBundle`.
Original file line number Diff line number Diff line change 1- type IntlCache = WeakMap < object , Record < string , object > > ;
1+ export type IntlCache = Map < object , Record < string , object > > ;
22
33const cache = new Map < string , IntlCache > ( ) ;
44
55export function getMemoizerForLocale ( locales : string | string [ ] ) : IntlCache {
66 const stringLocale = Array . isArray ( locales ) ? locales . join ( " " ) : locales ;
77 let memoizer = cache . get ( stringLocale ) ;
88 if ( memoizer === undefined ) {
9- memoizer = new WeakMap ( ) ;
9+ memoizer = new Map ( ) ;
1010 cache . set ( stringLocale , memoizer ) ;
1111 }
1212
You can’t perform that action at this time.
0 commit comments