@reforgium/presentia 2.1.0 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +177 -163
- package/README.md +1 -1
- package/bin/presentia-gen-namespaces.mjs +1298 -1248
- package/fesm2022/reforgium-presentia.mjs +4 -2
- package/package.json +1 -1
- package/types/reforgium-presentia.d.ts +1 -0
|
@@ -1452,7 +1452,7 @@ class LangPipe {
|
|
|
1452
1452
|
const existing = this.cache.get(key);
|
|
1453
1453
|
if (existing) {
|
|
1454
1454
|
if (now - existing.ts < this.ttlMs) {
|
|
1455
|
-
return existing.value();
|
|
1455
|
+
return this.applyNamespaceGuard(query, existing.value());
|
|
1456
1456
|
}
|
|
1457
1457
|
this.cache.delete(key);
|
|
1458
1458
|
}
|
|
@@ -1460,7 +1460,9 @@ class LangPipe {
|
|
|
1460
1460
|
this.cache.set(key, { value: this.lang.observe(query, params ?? undefined), ts: now });
|
|
1461
1461
|
this.evictIfNeeded();
|
|
1462
1462
|
}
|
|
1463
|
-
|
|
1463
|
+
return this.applyNamespaceGuard(query, this.cache.get(key).value());
|
|
1464
|
+
}
|
|
1465
|
+
applyNamespaceGuard(query, value) {
|
|
1464
1466
|
const ns = query.split('.', 1)[0];
|
|
1465
1467
|
if (ns && !this.lang.isNamespaceLoaded(ns)) {
|
|
1466
1468
|
const placeholder = this.config.placeholder;
|
package/package.json
CHANGED
|
@@ -608,6 +608,7 @@ declare class LangPipe implements PipeTransform {
|
|
|
608
608
|
private readonly maxCacheSize;
|
|
609
609
|
constructor();
|
|
610
610
|
transform(query: string | null | undefined, params?: LangParams | null): string;
|
|
611
|
+
private applyNamespaceGuard;
|
|
611
612
|
private makeKey;
|
|
612
613
|
private evictIfNeeded;
|
|
613
614
|
private warnUnresolvedKey;
|