@intlayer/core 7.5.0 → 7.5.1

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.
@@ -7,25 +7,29 @@ const createCachedConstructor = (Ctor) => {
7
7
  const cache = /* @__PURE__ */ new Map();
8
8
  function Wrapped(locales, options) {
9
9
  if (Ctor.name === "DisplayNames" && typeof Intl?.DisplayNames !== "function") {
10
- if (process.env.NODE_ENV === "development") throw new Error([
11
- `// Intl.DisplayNames is not supported; falling back to raw locale (${locales}). `,
12
- `// Consider adding a polyfill as https://formatjs.io/docs/polyfills/intl-displaynames/`,
13
- ``,
14
- `import 'intl';`,
15
- `import '@formatjs/intl-getcanonicallocales/polyfill';`,
16
- `import '@formatjs/intl-locale/polyfill';`,
17
- `import '@formatjs/intl-pluralrules/polyfill';`,
18
- `import '@formatjs/intl-displaynames/polyfill';`,
19
- `import '@formatjs/intl-listformat/polyfill';`,
20
- `import '@formatjs/intl-numberformat/polyfill';`,
21
- `import '@formatjs/intl-relativetimeformat/polyfill';`,
22
- `import '@formatjs/intl-datetimeformat/polyfill';`,
23
- ``,
24
- `// Optionally add locale data`,
25
- `import '@formatjs/intl-pluralrules/locale-data/fr';`,
26
- `import '@formatjs/intl-numberformat/locale-data/fr';`,
27
- `import '@formatjs/intl-datetimeformat/locale-data/fr';`
28
- ].join("\n"));
10
+ if (process.env.NODE_ENV === "development") {
11
+ const message = [
12
+ `// Intl.DisplayNames is not supported; falling back to raw locale (${locales}). `,
13
+ `// Consider adding a polyfill as https://formatjs.io/docs/polyfills/intl-displaynames/`,
14
+ ``,
15
+ `import 'intl';`,
16
+ `import '@formatjs/intl-displaynames/polyfill';`,
17
+ `import '@formatjs/intl-getcanonicallocales/polyfill';`,
18
+ `import '@formatjs/intl-locale/polyfill';`,
19
+ `import '@formatjs/intl-pluralrules/polyfill';`,
20
+ `import '@formatjs/intl-listformat/polyfill';`,
21
+ `import '@formatjs/intl-numberformat/polyfill';`,
22
+ `import '@formatjs/intl-relativetimeformat/polyfill';`,
23
+ `import '@formatjs/intl-datetimeformat/polyfill';`,
24
+ ``,
25
+ `// Optionally add locale data`,
26
+ `import '@formatjs/intl-pluralrules/locale-data/fr';`,
27
+ `import '@formatjs/intl-numberformat/locale-data/fr';`,
28
+ `import '@formatjs/intl-datetimeformat/locale-data/fr';`
29
+ ].join("\n");
30
+ console.warn(message);
31
+ throw new Error(message);
32
+ }
29
33
  return locales;
30
34
  }
31
35
  const key = cacheKey(locales ?? _intlayer_types.Locales.ENGLISH, options);
@@ -1 +1 @@
1
- {"version":3,"file":"intl.cjs","names":["Locales","instance: InstanceType<T> | undefined"],"sources":["../../../src/utils/intl.ts"],"sourcesContent":["// Cached Intl helper – drop‑in replacement for the global `Intl` object.\n// ‑‑‑\n// • Uses a `Proxy` to lazily wrap every *constructor* hanging off `Intl` (NumberFormat, DateTimeFormat, …).\n// • Each wrapped constructor keeps an in‑memory cache keyed by `[locales, options]` so that identical requests\n// reuse the same heavy instance instead of reparsing CLDR data every time.\n// • A polyfill warning for `Intl.DisplayNames` is emitted only once and only in dev.\n// • The public API is fully type‑safe and mirrors the native `Intl` surface exactly –\n// you can treat `CachedIntl` just like the built‑in `Intl`.\n//\n// Usage examples:\n// ---------------\n// import { CachedIntl } from \"./cached-intl\";\n//\n// const nf = CachedIntl.NumberFormat(\"en-US\", { style: \"currency\", currency: \"USD\" });\n// console.log(nf.format(1234));\n//\n// const dn = CachedIntl.DisplayNames([\"fr\"], { type: \"language\" });\n// console.log(dn.of(\"en\")); // → \"anglais\"\n//\n// You can also spin up an isolated instance with its own caches (handy in test suites):\n// const TestIntl = createCachedIntl();\n//\n// ---------------------------------------------------------------------\n\nimport { Locales, type LocalesValues } from '@intlayer/types';\n\n// Helper type that picks just the constructor members off `typeof Intl`.\n// The \"capital‑letter\" heuristic is 100 % accurate today and keeps the\n// mapping short‑lived, so we don't have to manually list every constructor.\ntype IntlConstructors = {\n [K in keyof typeof Intl as (typeof Intl)[K] extends new (\n ...args: any\n ) => any\n ? K\n : never]: (typeof Intl)[K];\n};\n\n// Type wrapper to replace locale arguments with LocalesValues\ntype ReplaceLocaleWithLocalesValues<T> = T extends new (\n locales: any,\n options?: infer Options\n) => infer Instance\n ? new (\n locales?: LocalesValues,\n options?: Options\n ) => Instance\n : T extends new (\n locales: any\n ) => infer Instance\n ? new (\n locales?: LocalesValues\n ) => Instance\n : T;\n\n// Wrapped Intl type with LocalesValues\ntype WrappedIntl = {\n [K in keyof typeof Intl]: K extends keyof IntlConstructors\n ? ReplaceLocaleWithLocalesValues<(typeof Intl)[K]>\n : (typeof Intl)[K];\n};\n\n// Generic cache key – JSON.stringify is fine because locale strings are short\n// and option objects are small and deterministic.\nconst cacheKey = (locales: LocalesValues, options: unknown) =>\n JSON.stringify([locales, options]);\n\n// Generic wrapper for any `new Intl.*()` constructor.\n// Returns a constructable function (usable with or without `new`) that\n// pulls instances from a Map cache when possible.\nconst createCachedConstructor = <T extends new (...args: any[]) => any>(\n Ctor: T\n) => {\n const cache = new Map<string, InstanceType<T>>();\n\n function Wrapped(locales?: LocalesValues, options?: any) {\n // Special case – guard older runtimes missing DisplayNames.\n if (\n Ctor.name === 'DisplayNames' &&\n typeof (Intl as any)?.DisplayNames !== 'function'\n ) {\n if (process.env.NODE_ENV === 'development') {\n throw new Error(\n [\n `// Intl.DisplayNames is not supported; falling back to raw locale (${locales}). `,\n `// Consider adding a polyfill as https://formatjs.io/docs/polyfills/intl-displaynames/`,\n ``,\n `import 'intl';`,\n `import '@formatjs/intl-getcanonicallocales/polyfill';`,\n `import '@formatjs/intl-locale/polyfill';`,\n `import '@formatjs/intl-pluralrules/polyfill';`,\n `import '@formatjs/intl-displaynames/polyfill';`,\n `import '@formatjs/intl-listformat/polyfill';`,\n `import '@formatjs/intl-numberformat/polyfill';`,\n `import '@formatjs/intl-relativetimeformat/polyfill';`,\n `import '@formatjs/intl-datetimeformat/polyfill';`,\n ``,\n `// Optionally add locale data`,\n `import '@formatjs/intl-pluralrules/locale-data/fr';`,\n `import '@formatjs/intl-numberformat/locale-data/fr';`,\n `import '@formatjs/intl-datetimeformat/locale-data/fr';`,\n ].join('\\n')\n );\n }\n return locales as any;\n }\n\n const key = cacheKey(locales ?? Locales.ENGLISH, options);\n let instance: InstanceType<T> | undefined = cache.get(key);\n\n if (!instance) {\n instance = new Ctor(locales as never, options as never);\n cache.set(key, instance as InstanceType<T>);\n }\n\n return instance as InstanceType<T>;\n }\n\n // Ensure it behaves like a constructor when used with `new`.\n (Wrapped as any).prototype = (Ctor as any).prototype;\n\n return Wrapped as unknown as ReplaceLocaleWithLocalesValues<T>;\n};\n\n// Factory that turns the global `Intl` into a cached clone.\nexport const createCachedIntl = (): WrappedIntl =>\n new Proxy(Intl as IntlConstructors, {\n get: (target, prop, receiver) => {\n const value = Reflect.get(target, prop, receiver);\n\n // Wrap *only* constructor functions (safest heuristic: they start with a capital letter).\n return typeof value === 'function' && /^[A-Z]/.test(String(prop))\n ? createCachedConstructor(value)\n : value;\n },\n }) as unknown as WrappedIntl;\n\n// Singleton – import this in application code if you just want shared caches.\nexport const CachedIntl = createCachedIntl();\n\n// new CachedIntl.DisplayNames(Locales.FRENCH, { type: 'language' });\n// new CachedIntl.DisplayNames('fr', { type: 'language' });\n// new CachedIntl.DateTimeFormat('fr', {\n// year: 'numeric',\n// month: 'long',\n// day: 'numeric',\n// });\n// new CachedIntl.NumberFormat('fr', {\n// style: 'currency',\n// currency: 'EUR',\n// });\n// new CachedIntl.Collator('fr', { sensitivity: 'base' });\n// new CachedIntl.PluralRules('fr');\n// new CachedIntl.RelativeTimeFormat('fr', { numeric: 'auto' });\n// new CachedIntl.ListFormat('fr', { type: 'conjunction' });\n\nexport { CachedIntl as Intl };\n"],"mappings":";;;;AA+DA,MAAM,YAAY,SAAwB,YACxC,KAAK,UAAU,CAAC,SAAS,QAAQ,CAAC;AAKpC,MAAM,2BACJ,SACG;CACH,MAAM,wBAAQ,IAAI,KAA8B;CAEhD,SAAS,QAAQ,SAAyB,SAAe;AAEvD,MACE,KAAK,SAAS,kBACd,OAAQ,MAAc,iBAAiB,YACvC;AACA,OAAI,QAAQ,IAAI,aAAa,cAC3B,OAAM,IAAI,MACR;IACE,sEAAsE,QAAQ;IAC9E;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACD,CAAC,KAAK,KAAK,CACb;AAEH,UAAO;;EAGT,MAAM,MAAM,SAAS,WAAWA,wBAAQ,SAAS,QAAQ;EACzD,IAAIC,WAAwC,MAAM,IAAI,IAAI;AAE1D,MAAI,CAAC,UAAU;AACb,cAAW,IAAI,KAAK,SAAkB,QAAiB;AACvD,SAAM,IAAI,KAAK,SAA4B;;AAG7C,SAAO;;AAIT,CAAC,QAAgB,YAAa,KAAa;AAE3C,QAAO;;AAIT,MAAa,yBACX,IAAI,MAAM,MAA0B,EAClC,MAAM,QAAQ,MAAM,aAAa;CAC/B,MAAM,QAAQ,QAAQ,IAAI,QAAQ,MAAM,SAAS;AAGjD,QAAO,OAAO,UAAU,cAAc,SAAS,KAAK,OAAO,KAAK,CAAC,GAC7D,wBAAwB,MAAM,GAC9B;GAEP,CAAC;AAGJ,MAAa,aAAa,kBAAkB"}
1
+ {"version":3,"file":"intl.cjs","names":["Locales","instance: InstanceType<T> | undefined"],"sources":["../../../src/utils/intl.ts"],"sourcesContent":["// Cached Intl helper – drop‑in replacement for the global `Intl` object.\n// ‑‑‑\n// • Uses a `Proxy` to lazily wrap every *constructor* hanging off `Intl` (NumberFormat, DateTimeFormat, …).\n// • Each wrapped constructor keeps an in‑memory cache keyed by `[locales, options]` so that identical requests\n// reuse the same heavy instance instead of reparsing CLDR data every time.\n// • A polyfill warning for `Intl.DisplayNames` is emitted only once and only in dev.\n// • The public API is fully type‑safe and mirrors the native `Intl` surface exactly –\n// you can treat `CachedIntl` just like the built‑in `Intl`.\n//\n// Usage examples:\n// ---------------\n// import { CachedIntl } from \"./cached-intl\";\n//\n// const nf = CachedIntl.NumberFormat(\"en-US\", { style: \"currency\", currency: \"USD\" });\n// console.log(nf.format(1234));\n//\n// const dn = CachedIntl.DisplayNames([\"fr\"], { type: \"language\" });\n// console.log(dn.of(\"en\")); // → \"anglais\"\n//\n// You can also spin up an isolated instance with its own caches (handy in test suites):\n// const TestIntl = createCachedIntl();\n//\n// ---------------------------------------------------------------------\n\nimport { Locales, type LocalesValues } from '@intlayer/types';\n\n// Helper type that picks just the constructor members off `typeof Intl`.\n// The \"capital‑letter\" heuristic is 100 % accurate today and keeps the\n// mapping short‑lived, so we don't have to manually list every constructor.\ntype IntlConstructors = {\n [K in keyof typeof Intl as (typeof Intl)[K] extends new (\n ...args: any\n ) => any\n ? K\n : never]: (typeof Intl)[K];\n};\n\n// Type wrapper to replace locale arguments with LocalesValues\ntype ReplaceLocaleWithLocalesValues<T> = T extends new (\n locales: any,\n options?: infer Options\n) => infer Instance\n ? new (\n locales?: LocalesValues,\n options?: Options\n ) => Instance\n : T extends new (\n locales: any\n ) => infer Instance\n ? new (\n locales?: LocalesValues\n ) => Instance\n : T;\n\n// Wrapped Intl type with LocalesValues\ntype WrappedIntl = {\n [K in keyof typeof Intl]: K extends keyof IntlConstructors\n ? ReplaceLocaleWithLocalesValues<(typeof Intl)[K]>\n : (typeof Intl)[K];\n};\n\n// Generic cache key – JSON.stringify is fine because locale strings are short\n// and option objects are small and deterministic.\nconst cacheKey = (locales: LocalesValues, options: unknown) =>\n JSON.stringify([locales, options]);\n\n// Generic wrapper for any `new Intl.*()` constructor.\n// Returns a constructable function (usable with or without `new`) that\n// pulls instances from a Map cache when possible.\nconst createCachedConstructor = <T extends new (...args: any[]) => any>(\n Ctor: T\n) => {\n const cache = new Map<string, InstanceType<T>>();\n\n function Wrapped(locales?: LocalesValues, options?: any) {\n // Special case – guard older runtimes missing DisplayNames.\n if (\n Ctor.name === 'DisplayNames' &&\n typeof (Intl as any)?.DisplayNames !== 'function'\n ) {\n if (process.env.NODE_ENV === 'development') {\n const message = [\n `// Intl.DisplayNames is not supported; falling back to raw locale (${locales}). `,\n `// Consider adding a polyfill as https://formatjs.io/docs/polyfills/intl-displaynames/`,\n ``,\n `import 'intl';`,\n `import '@formatjs/intl-displaynames/polyfill';`,\n `import '@formatjs/intl-getcanonicallocales/polyfill';`,\n `import '@formatjs/intl-locale/polyfill';`,\n `import '@formatjs/intl-pluralrules/polyfill';`,\n `import '@formatjs/intl-listformat/polyfill';`,\n `import '@formatjs/intl-numberformat/polyfill';`,\n `import '@formatjs/intl-relativetimeformat/polyfill';`,\n `import '@formatjs/intl-datetimeformat/polyfill';`,\n ``,\n `// Optionally add locale data`,\n `import '@formatjs/intl-pluralrules/locale-data/fr';`,\n `import '@formatjs/intl-numberformat/locale-data/fr';`,\n `import '@formatjs/intl-datetimeformat/locale-data/fr';`,\n ].join('\\n');\n\n console.warn(message);\n throw new Error(message);\n }\n return locales as any;\n }\n\n const key = cacheKey(locales ?? Locales.ENGLISH, options);\n let instance: InstanceType<T> | undefined = cache.get(key);\n\n if (!instance) {\n instance = new Ctor(locales as never, options as never);\n cache.set(key, instance as InstanceType<T>);\n }\n\n return instance as InstanceType<T>;\n }\n\n // Ensure it behaves like a constructor when used with `new`.\n (Wrapped as any).prototype = (Ctor as any).prototype;\n\n return Wrapped as unknown as ReplaceLocaleWithLocalesValues<T>;\n};\n\n// Factory that turns the global `Intl` into a cached clone.\nexport const createCachedIntl = (): WrappedIntl =>\n new Proxy(Intl as IntlConstructors, {\n get: (target, prop, receiver) => {\n const value = Reflect.get(target, prop, receiver);\n\n // Wrap *only* constructor functions (safest heuristic: they start with a capital letter).\n return typeof value === 'function' && /^[A-Z]/.test(String(prop))\n ? createCachedConstructor(value)\n : value;\n },\n }) as unknown as WrappedIntl;\n\n// Singleton – import this in application code if you just want shared caches.\nexport const CachedIntl = createCachedIntl();\n\n// new CachedIntl.DisplayNames(Locales.FRENCH, { type: 'language' });\n// new CachedIntl.DisplayNames('fr', { type: 'language' });\n// new CachedIntl.DateTimeFormat('fr', {\n// year: 'numeric',\n// month: 'long',\n// day: 'numeric',\n// });\n// new CachedIntl.NumberFormat('fr', {\n// style: 'currency',\n// currency: 'EUR',\n// });\n// new CachedIntl.Collator('fr', { sensitivity: 'base' });\n// new CachedIntl.PluralRules('fr');\n// new CachedIntl.RelativeTimeFormat('fr', { numeric: 'auto' });\n// new CachedIntl.ListFormat('fr', { type: 'conjunction' });\n\nexport { CachedIntl as Intl };\n"],"mappings":";;;;AA+DA,MAAM,YAAY,SAAwB,YACxC,KAAK,UAAU,CAAC,SAAS,QAAQ,CAAC;AAKpC,MAAM,2BACJ,SACG;CACH,MAAM,wBAAQ,IAAI,KAA8B;CAEhD,SAAS,QAAQ,SAAyB,SAAe;AAEvD,MACE,KAAK,SAAS,kBACd,OAAQ,MAAc,iBAAiB,YACvC;AACA,OAAI,QAAQ,IAAI,aAAa,eAAe;IAC1C,MAAM,UAAU;KACd,sEAAsE,QAAQ;KAC9E;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACD,CAAC,KAAK,KAAK;AAEZ,YAAQ,KAAK,QAAQ;AACrB,UAAM,IAAI,MAAM,QAAQ;;AAE1B,UAAO;;EAGT,MAAM,MAAM,SAAS,WAAWA,wBAAQ,SAAS,QAAQ;EACzD,IAAIC,WAAwC,MAAM,IAAI,IAAI;AAE1D,MAAI,CAAC,UAAU;AACb,cAAW,IAAI,KAAK,SAAkB,QAAiB;AACvD,SAAM,IAAI,KAAK,SAA4B;;AAG7C,SAAO;;AAIT,CAAC,QAAgB,YAAa,KAAa;AAE3C,QAAO;;AAIT,MAAa,yBACX,IAAI,MAAM,MAA0B,EAClC,MAAM,QAAQ,MAAM,aAAa;CAC/B,MAAM,QAAQ,QAAQ,IAAI,QAAQ,MAAM,SAAS;AAGjD,QAAO,OAAO,UAAU,cAAc,SAAS,KAAK,OAAO,KAAK,CAAC,GAC7D,wBAAwB,MAAM,GAC9B;GAEP,CAAC;AAGJ,MAAa,aAAa,kBAAkB"}
@@ -5,25 +5,32 @@ const cacheKey = (locales, options) => JSON.stringify([locales, options]);
5
5
  const createCachedConstructor = (Ctor) => {
6
6
  const cache = /* @__PURE__ */ new Map();
7
7
  function Wrapped(locales, options) {
8
- if (Ctor.name === "DisplayNames" && typeof Intl?.DisplayNames !== "function") throw new Error([
9
- `// Intl.DisplayNames is not supported; falling back to raw locale (${locales}). `,
10
- `// Consider adding a polyfill as https://formatjs.io/docs/polyfills/intl-displaynames/`,
11
- ``,
12
- `import 'intl';`,
13
- `import '@formatjs/intl-getcanonicallocales/polyfill';`,
14
- `import '@formatjs/intl-locale/polyfill';`,
15
- `import '@formatjs/intl-pluralrules/polyfill';`,
16
- `import '@formatjs/intl-displaynames/polyfill';`,
17
- `import '@formatjs/intl-listformat/polyfill';`,
18
- `import '@formatjs/intl-numberformat/polyfill';`,
19
- `import '@formatjs/intl-relativetimeformat/polyfill';`,
20
- `import '@formatjs/intl-datetimeformat/polyfill';`,
21
- ``,
22
- `// Optionally add locale data`,
23
- `import '@formatjs/intl-pluralrules/locale-data/fr';`,
24
- `import '@formatjs/intl-numberformat/locale-data/fr';`,
25
- `import '@formatjs/intl-datetimeformat/locale-data/fr';`
26
- ].join("\n"));
8
+ if (Ctor.name === "DisplayNames" && typeof Intl?.DisplayNames !== "function") {
9
+ {
10
+ const message = [
11
+ `// Intl.DisplayNames is not supported; falling back to raw locale (${locales}). `,
12
+ `// Consider adding a polyfill as https://formatjs.io/docs/polyfills/intl-displaynames/`,
13
+ ``,
14
+ `import 'intl';`,
15
+ `import '@formatjs/intl-displaynames/polyfill';`,
16
+ `import '@formatjs/intl-getcanonicallocales/polyfill';`,
17
+ `import '@formatjs/intl-locale/polyfill';`,
18
+ `import '@formatjs/intl-pluralrules/polyfill';`,
19
+ `import '@formatjs/intl-listformat/polyfill';`,
20
+ `import '@formatjs/intl-numberformat/polyfill';`,
21
+ `import '@formatjs/intl-relativetimeformat/polyfill';`,
22
+ `import '@formatjs/intl-datetimeformat/polyfill';`,
23
+ ``,
24
+ `// Optionally add locale data`,
25
+ `import '@formatjs/intl-pluralrules/locale-data/fr';`,
26
+ `import '@formatjs/intl-numberformat/locale-data/fr';`,
27
+ `import '@formatjs/intl-datetimeformat/locale-data/fr';`
28
+ ].join("\n");
29
+ console.warn(message);
30
+ throw new Error(message);
31
+ }
32
+ return locales;
33
+ }
27
34
  const key = cacheKey(locales ?? Locales.ENGLISH, options);
28
35
  let instance = cache.get(key);
29
36
  if (!instance) {
@@ -1 +1 @@
1
- {"version":3,"file":"intl.mjs","names":["instance: InstanceType<T> | undefined"],"sources":["../../../src/utils/intl.ts"],"sourcesContent":["// Cached Intl helper – drop‑in replacement for the global `Intl` object.\n// ‑‑‑\n// • Uses a `Proxy` to lazily wrap every *constructor* hanging off `Intl` (NumberFormat, DateTimeFormat, …).\n// • Each wrapped constructor keeps an in‑memory cache keyed by `[locales, options]` so that identical requests\n// reuse the same heavy instance instead of reparsing CLDR data every time.\n// • A polyfill warning for `Intl.DisplayNames` is emitted only once and only in dev.\n// • The public API is fully type‑safe and mirrors the native `Intl` surface exactly –\n// you can treat `CachedIntl` just like the built‑in `Intl`.\n//\n// Usage examples:\n// ---------------\n// import { CachedIntl } from \"./cached-intl\";\n//\n// const nf = CachedIntl.NumberFormat(\"en-US\", { style: \"currency\", currency: \"USD\" });\n// console.log(nf.format(1234));\n//\n// const dn = CachedIntl.DisplayNames([\"fr\"], { type: \"language\" });\n// console.log(dn.of(\"en\")); // → \"anglais\"\n//\n// You can also spin up an isolated instance with its own caches (handy in test suites):\n// const TestIntl = createCachedIntl();\n//\n// ---------------------------------------------------------------------\n\nimport { Locales, type LocalesValues } from '@intlayer/types';\n\n// Helper type that picks just the constructor members off `typeof Intl`.\n// The \"capital‑letter\" heuristic is 100 % accurate today and keeps the\n// mapping short‑lived, so we don't have to manually list every constructor.\ntype IntlConstructors = {\n [K in keyof typeof Intl as (typeof Intl)[K] extends new (\n ...args: any\n ) => any\n ? K\n : never]: (typeof Intl)[K];\n};\n\n// Type wrapper to replace locale arguments with LocalesValues\ntype ReplaceLocaleWithLocalesValues<T> = T extends new (\n locales: any,\n options?: infer Options\n) => infer Instance\n ? new (\n locales?: LocalesValues,\n options?: Options\n ) => Instance\n : T extends new (\n locales: any\n ) => infer Instance\n ? new (\n locales?: LocalesValues\n ) => Instance\n : T;\n\n// Wrapped Intl type with LocalesValues\ntype WrappedIntl = {\n [K in keyof typeof Intl]: K extends keyof IntlConstructors\n ? ReplaceLocaleWithLocalesValues<(typeof Intl)[K]>\n : (typeof Intl)[K];\n};\n\n// Generic cache key – JSON.stringify is fine because locale strings are short\n// and option objects are small and deterministic.\nconst cacheKey = (locales: LocalesValues, options: unknown) =>\n JSON.stringify([locales, options]);\n\n// Generic wrapper for any `new Intl.*()` constructor.\n// Returns a constructable function (usable with or without `new`) that\n// pulls instances from a Map cache when possible.\nconst createCachedConstructor = <T extends new (...args: any[]) => any>(\n Ctor: T\n) => {\n const cache = new Map<string, InstanceType<T>>();\n\n function Wrapped(locales?: LocalesValues, options?: any) {\n // Special case – guard older runtimes missing DisplayNames.\n if (\n Ctor.name === 'DisplayNames' &&\n typeof (Intl as any)?.DisplayNames !== 'function'\n ) {\n if (process.env.NODE_ENV === 'development') {\n throw new Error(\n [\n `// Intl.DisplayNames is not supported; falling back to raw locale (${locales}). `,\n `// Consider adding a polyfill as https://formatjs.io/docs/polyfills/intl-displaynames/`,\n ``,\n `import 'intl';`,\n `import '@formatjs/intl-getcanonicallocales/polyfill';`,\n `import '@formatjs/intl-locale/polyfill';`,\n `import '@formatjs/intl-pluralrules/polyfill';`,\n `import '@formatjs/intl-displaynames/polyfill';`,\n `import '@formatjs/intl-listformat/polyfill';`,\n `import '@formatjs/intl-numberformat/polyfill';`,\n `import '@formatjs/intl-relativetimeformat/polyfill';`,\n `import '@formatjs/intl-datetimeformat/polyfill';`,\n ``,\n `// Optionally add locale data`,\n `import '@formatjs/intl-pluralrules/locale-data/fr';`,\n `import '@formatjs/intl-numberformat/locale-data/fr';`,\n `import '@formatjs/intl-datetimeformat/locale-data/fr';`,\n ].join('\\n')\n );\n }\n return locales as any;\n }\n\n const key = cacheKey(locales ?? Locales.ENGLISH, options);\n let instance: InstanceType<T> | undefined = cache.get(key);\n\n if (!instance) {\n instance = new Ctor(locales as never, options as never);\n cache.set(key, instance as InstanceType<T>);\n }\n\n return instance as InstanceType<T>;\n }\n\n // Ensure it behaves like a constructor when used with `new`.\n (Wrapped as any).prototype = (Ctor as any).prototype;\n\n return Wrapped as unknown as ReplaceLocaleWithLocalesValues<T>;\n};\n\n// Factory that turns the global `Intl` into a cached clone.\nexport const createCachedIntl = (): WrappedIntl =>\n new Proxy(Intl as IntlConstructors, {\n get: (target, prop, receiver) => {\n const value = Reflect.get(target, prop, receiver);\n\n // Wrap *only* constructor functions (safest heuristic: they start with a capital letter).\n return typeof value === 'function' && /^[A-Z]/.test(String(prop))\n ? createCachedConstructor(value)\n : value;\n },\n }) as unknown as WrappedIntl;\n\n// Singleton – import this in application code if you just want shared caches.\nexport const CachedIntl = createCachedIntl();\n\n// new CachedIntl.DisplayNames(Locales.FRENCH, { type: 'language' });\n// new CachedIntl.DisplayNames('fr', { type: 'language' });\n// new CachedIntl.DateTimeFormat('fr', {\n// year: 'numeric',\n// month: 'long',\n// day: 'numeric',\n// });\n// new CachedIntl.NumberFormat('fr', {\n// style: 'currency',\n// currency: 'EUR',\n// });\n// new CachedIntl.Collator('fr', { sensitivity: 'base' });\n// new CachedIntl.PluralRules('fr');\n// new CachedIntl.RelativeTimeFormat('fr', { numeric: 'auto' });\n// new CachedIntl.ListFormat('fr', { type: 'conjunction' });\n\nexport { CachedIntl as Intl };\n"],"mappings":";;;AA+DA,MAAM,YAAY,SAAwB,YACxC,KAAK,UAAU,CAAC,SAAS,QAAQ,CAAC;AAKpC,MAAM,2BACJ,SACG;CACH,MAAM,wBAAQ,IAAI,KAA8B;CAEhD,SAAS,QAAQ,SAAyB,SAAe;AAEvD,MACE,KAAK,SAAS,kBACd,OAAQ,MAAc,iBAAiB,WAGrC,OAAM,IAAI,MACR;GACE,sEAAsE,QAAQ;GAC9E;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAC,KAAK,KAAK,CACb;EAKL,MAAM,MAAM,SAAS,WAAW,QAAQ,SAAS,QAAQ;EACzD,IAAIA,WAAwC,MAAM,IAAI,IAAI;AAE1D,MAAI,CAAC,UAAU;AACb,cAAW,IAAI,KAAK,SAAkB,QAAiB;AACvD,SAAM,IAAI,KAAK,SAA4B;;AAG7C,SAAO;;AAIT,CAAC,QAAgB,YAAa,KAAa;AAE3C,QAAO;;AAIT,MAAa,yBACX,IAAI,MAAM,MAA0B,EAClC,MAAM,QAAQ,MAAM,aAAa;CAC/B,MAAM,QAAQ,QAAQ,IAAI,QAAQ,MAAM,SAAS;AAGjD,QAAO,OAAO,UAAU,cAAc,SAAS,KAAK,OAAO,KAAK,CAAC,GAC7D,wBAAwB,MAAM,GAC9B;GAEP,CAAC;AAGJ,MAAa,aAAa,kBAAkB"}
1
+ {"version":3,"file":"intl.mjs","names":["instance: InstanceType<T> | undefined"],"sources":["../../../src/utils/intl.ts"],"sourcesContent":["// Cached Intl helper – drop‑in replacement for the global `Intl` object.\n// ‑‑‑\n// • Uses a `Proxy` to lazily wrap every *constructor* hanging off `Intl` (NumberFormat, DateTimeFormat, …).\n// • Each wrapped constructor keeps an in‑memory cache keyed by `[locales, options]` so that identical requests\n// reuse the same heavy instance instead of reparsing CLDR data every time.\n// • A polyfill warning for `Intl.DisplayNames` is emitted only once and only in dev.\n// • The public API is fully type‑safe and mirrors the native `Intl` surface exactly –\n// you can treat `CachedIntl` just like the built‑in `Intl`.\n//\n// Usage examples:\n// ---------------\n// import { CachedIntl } from \"./cached-intl\";\n//\n// const nf = CachedIntl.NumberFormat(\"en-US\", { style: \"currency\", currency: \"USD\" });\n// console.log(nf.format(1234));\n//\n// const dn = CachedIntl.DisplayNames([\"fr\"], { type: \"language\" });\n// console.log(dn.of(\"en\")); // → \"anglais\"\n//\n// You can also spin up an isolated instance with its own caches (handy in test suites):\n// const TestIntl = createCachedIntl();\n//\n// ---------------------------------------------------------------------\n\nimport { Locales, type LocalesValues } from '@intlayer/types';\n\n// Helper type that picks just the constructor members off `typeof Intl`.\n// The \"capital‑letter\" heuristic is 100 % accurate today and keeps the\n// mapping short‑lived, so we don't have to manually list every constructor.\ntype IntlConstructors = {\n [K in keyof typeof Intl as (typeof Intl)[K] extends new (\n ...args: any\n ) => any\n ? K\n : never]: (typeof Intl)[K];\n};\n\n// Type wrapper to replace locale arguments with LocalesValues\ntype ReplaceLocaleWithLocalesValues<T> = T extends new (\n locales: any,\n options?: infer Options\n) => infer Instance\n ? new (\n locales?: LocalesValues,\n options?: Options\n ) => Instance\n : T extends new (\n locales: any\n ) => infer Instance\n ? new (\n locales?: LocalesValues\n ) => Instance\n : T;\n\n// Wrapped Intl type with LocalesValues\ntype WrappedIntl = {\n [K in keyof typeof Intl]: K extends keyof IntlConstructors\n ? ReplaceLocaleWithLocalesValues<(typeof Intl)[K]>\n : (typeof Intl)[K];\n};\n\n// Generic cache key – JSON.stringify is fine because locale strings are short\n// and option objects are small and deterministic.\nconst cacheKey = (locales: LocalesValues, options: unknown) =>\n JSON.stringify([locales, options]);\n\n// Generic wrapper for any `new Intl.*()` constructor.\n// Returns a constructable function (usable with or without `new`) that\n// pulls instances from a Map cache when possible.\nconst createCachedConstructor = <T extends new (...args: any[]) => any>(\n Ctor: T\n) => {\n const cache = new Map<string, InstanceType<T>>();\n\n function Wrapped(locales?: LocalesValues, options?: any) {\n // Special case – guard older runtimes missing DisplayNames.\n if (\n Ctor.name === 'DisplayNames' &&\n typeof (Intl as any)?.DisplayNames !== 'function'\n ) {\n if (process.env.NODE_ENV === 'development') {\n const message = [\n `// Intl.DisplayNames is not supported; falling back to raw locale (${locales}). `,\n `// Consider adding a polyfill as https://formatjs.io/docs/polyfills/intl-displaynames/`,\n ``,\n `import 'intl';`,\n `import '@formatjs/intl-displaynames/polyfill';`,\n `import '@formatjs/intl-getcanonicallocales/polyfill';`,\n `import '@formatjs/intl-locale/polyfill';`,\n `import '@formatjs/intl-pluralrules/polyfill';`,\n `import '@formatjs/intl-listformat/polyfill';`,\n `import '@formatjs/intl-numberformat/polyfill';`,\n `import '@formatjs/intl-relativetimeformat/polyfill';`,\n `import '@formatjs/intl-datetimeformat/polyfill';`,\n ``,\n `// Optionally add locale data`,\n `import '@formatjs/intl-pluralrules/locale-data/fr';`,\n `import '@formatjs/intl-numberformat/locale-data/fr';`,\n `import '@formatjs/intl-datetimeformat/locale-data/fr';`,\n ].join('\\n');\n\n console.warn(message);\n throw new Error(message);\n }\n return locales as any;\n }\n\n const key = cacheKey(locales ?? Locales.ENGLISH, options);\n let instance: InstanceType<T> | undefined = cache.get(key);\n\n if (!instance) {\n instance = new Ctor(locales as never, options as never);\n cache.set(key, instance as InstanceType<T>);\n }\n\n return instance as InstanceType<T>;\n }\n\n // Ensure it behaves like a constructor when used with `new`.\n (Wrapped as any).prototype = (Ctor as any).prototype;\n\n return Wrapped as unknown as ReplaceLocaleWithLocalesValues<T>;\n};\n\n// Factory that turns the global `Intl` into a cached clone.\nexport const createCachedIntl = (): WrappedIntl =>\n new Proxy(Intl as IntlConstructors, {\n get: (target, prop, receiver) => {\n const value = Reflect.get(target, prop, receiver);\n\n // Wrap *only* constructor functions (safest heuristic: they start with a capital letter).\n return typeof value === 'function' && /^[A-Z]/.test(String(prop))\n ? createCachedConstructor(value)\n : value;\n },\n }) as unknown as WrappedIntl;\n\n// Singleton – import this in application code if you just want shared caches.\nexport const CachedIntl = createCachedIntl();\n\n// new CachedIntl.DisplayNames(Locales.FRENCH, { type: 'language' });\n// new CachedIntl.DisplayNames('fr', { type: 'language' });\n// new CachedIntl.DateTimeFormat('fr', {\n// year: 'numeric',\n// month: 'long',\n// day: 'numeric',\n// });\n// new CachedIntl.NumberFormat('fr', {\n// style: 'currency',\n// currency: 'EUR',\n// });\n// new CachedIntl.Collator('fr', { sensitivity: 'base' });\n// new CachedIntl.PluralRules('fr');\n// new CachedIntl.RelativeTimeFormat('fr', { numeric: 'auto' });\n// new CachedIntl.ListFormat('fr', { type: 'conjunction' });\n\nexport { CachedIntl as Intl };\n"],"mappings":";;;AA+DA,MAAM,YAAY,SAAwB,YACxC,KAAK,UAAU,CAAC,SAAS,QAAQ,CAAC;AAKpC,MAAM,2BACJ,SACG;CACH,MAAM,wBAAQ,IAAI,KAA8B;CAEhD,SAAS,QAAQ,SAAyB,SAAe;AAEvD,MACE,KAAK,SAAS,kBACd,OAAQ,MAAc,iBAAiB,YACvC;GAC4C;IAC1C,MAAM,UAAU;KACd,sEAAsE,QAAQ;KAC9E;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACD,CAAC,KAAK,KAAK;AAEZ,YAAQ,KAAK,QAAQ;AACrB,UAAM,IAAI,MAAM,QAAQ;;AAE1B,UAAO;;EAGT,MAAM,MAAM,SAAS,WAAW,QAAQ,SAAS,QAAQ;EACzD,IAAIA,WAAwC,MAAM,IAAI,IAAI;AAE1D,MAAI,CAAC,UAAU;AACb,cAAW,IAAI,KAAK,SAAkB,QAAiB;AACvD,SAAM,IAAI,KAAK,SAA4B;;AAG7C,SAAO;;AAIT,CAAC,QAAgB,YAAa,KAAa;AAE3C,QAAO;;AAIT,MAAa,yBACX,IAAI,MAAM,MAA0B,EAClC,MAAM,QAAQ,MAAM,aAAa;CAC/B,MAAM,QAAQ,QAAQ,IAAI,QAAQ,MAAM,SAAS;AAGjD,QAAO,OAAO,UAAU,cAAc,SAAS,KAAK,OAAO,KAAK,CAAC,GAC7D,wBAAwB,MAAM,GAC9B;GAEP,CAAC;AAGJ,MAAa,aAAa,kBAAkB"}
@@ -1,6 +1,6 @@
1
1
  import { NodeProps, Plugins } from "../interpreter/getContent/plugins.js";
2
2
  import "../interpreter/index.js";
3
- import * as _intlayer_types0 from "@intlayer/types";
3
+ import * as _intlayer_types13 from "@intlayer/types";
4
4
  import { ContentNode, DeclaredLocales, Dictionary, LocalesValues } from "@intlayer/types";
5
5
 
6
6
  //#region src/deepTransformPlugins/getFilterMissingTranslationsContent.d.ts
@@ -24,12 +24,12 @@ declare const getFilterMissingTranslationsContent: <T extends ContentNode, L ext
24
24
  declare const getFilterMissingTranslationsDictionary: (dictionary: Dictionary, localeToCheck: LocalesValues) => {
25
25
  content: any;
26
26
  $schema?: string;
27
- id?: _intlayer_types0.DictionaryId;
27
+ id?: _intlayer_types13.DictionaryId;
28
28
  projectIds?: string[];
29
- localId?: _intlayer_types0.LocalDictionaryId;
30
- localIds?: _intlayer_types0.LocalDictionaryId[];
31
- format?: _intlayer_types0.DictionaryFormat;
32
- key: _intlayer_types0.DictionaryKey;
29
+ localId?: _intlayer_types13.LocalDictionaryId;
30
+ localIds?: _intlayer_types13.LocalDictionaryId[];
31
+ format?: _intlayer_types13.DictionaryFormat;
32
+ key: _intlayer_types13.DictionaryKey;
33
33
  title?: string;
34
34
  description?: string;
35
35
  versions?: string[];
@@ -37,11 +37,11 @@ declare const getFilterMissingTranslationsDictionary: (dictionary: Dictionary, l
37
37
  filePath?: string;
38
38
  tags?: string[];
39
39
  locale?: LocalesValues;
40
- fill?: _intlayer_types0.Fill;
40
+ fill?: _intlayer_types13.Fill;
41
41
  filled?: true;
42
42
  priority?: number;
43
43
  live?: boolean;
44
- location?: _intlayer_types0.DictionaryLocation;
44
+ location?: _intlayer_types13.DictionaryLocation;
45
45
  };
46
46
  //#endregion
47
47
  export { filterMissingTranslationsOnlyPlugin, getFilterMissingTranslationsContent, getFilterMissingTranslationsDictionary };
@@ -1 +1 @@
1
- {"version":3,"file":"getFilterMissingTranslationsContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getFilterMissingTranslationsContent.ts"],"sourcesContent":[],"mappings":";;;;;;;cAmMa,qDACI,kBACd;;AAFH;AA8LA;;;;;;;;AA0BA;;;;cA1Ba,gDACD,uBACA,gBAAgB,uBAEpB,kBACS,cACJ;cAoBA,qDACC,2BACG;;;OAAa,gBAAA,CAAA"}
1
+ {"version":3,"file":"getFilterMissingTranslationsContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getFilterMissingTranslationsContent.ts"],"sourcesContent":[],"mappings":";;;;;;;cAmMa,qDACI,kBACd;;AAFH;AA8LA;;;;;;;;AA0BA;;;;cA1Ba,gDACD,uBACA,gBAAgB,uBAEpB,kBACS,cACJ;cAoBA,qDACC,2BACG;;;OAAa,iBAAA,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { DeepTransformContent, NodeProps, Plugins } from "../interpreter/getContent/plugins.js";
2
2
  import "../interpreter/index.js";
3
- import * as _intlayer_types14 from "@intlayer/types";
3
+ import * as _intlayer_types6 from "@intlayer/types";
4
4
  import { ContentNode, DeclaredLocales, Dictionary, LocalesValues } from "@intlayer/types";
5
5
 
6
6
  //#region src/deepTransformPlugins/getFilterTranslationsOnlyContent.d.ts
@@ -16,12 +16,12 @@ declare const getFilterTranslationsOnlyContent: <T extends ContentNode, L extend
16
16
  declare const getFilterTranslationsOnlyDictionary: (dictionary: Dictionary, locale?: LocalesValues, fallback?: LocalesValues) => {
17
17
  content: any;
18
18
  $schema?: string;
19
- id?: _intlayer_types14.DictionaryId;
19
+ id?: _intlayer_types6.DictionaryId;
20
20
  projectIds?: string[];
21
- localId?: _intlayer_types14.LocalDictionaryId;
22
- localIds?: _intlayer_types14.LocalDictionaryId[];
23
- format?: _intlayer_types14.DictionaryFormat;
24
- key: _intlayer_types14.DictionaryKey;
21
+ localId?: _intlayer_types6.LocalDictionaryId;
22
+ localIds?: _intlayer_types6.LocalDictionaryId[];
23
+ format?: _intlayer_types6.DictionaryFormat;
24
+ key: _intlayer_types6.DictionaryKey;
25
25
  title?: string;
26
26
  description?: string;
27
27
  versions?: string[];
@@ -29,11 +29,11 @@ declare const getFilterTranslationsOnlyDictionary: (dictionary: Dictionary, loca
29
29
  filePath?: string;
30
30
  tags?: string[];
31
31
  locale?: LocalesValues;
32
- fill?: _intlayer_types14.Fill;
32
+ fill?: _intlayer_types6.Fill;
33
33
  filled?: true;
34
34
  priority?: number;
35
35
  live?: boolean;
36
- location?: _intlayer_types14.DictionaryLocation;
36
+ location?: _intlayer_types6.DictionaryLocation;
37
37
  };
38
38
  //#endregion
39
39
  export { filterTranslationsOnlyPlugin, getFilterTranslationsOnlyContent, getFilterTranslationsOnlyDictionary };
@@ -1 +1 @@
1
- {"version":3,"file":"getFilterTranslationsOnlyContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getFilterTranslationsOnlyContent.ts"],"sourcesContent":[],"mappings":";;;;;;;cAoCa,uCACH,0BACG,kBACV;;AAHH;;;;;AAuFa,cAAA,gCAkBZ,EAAA,CAAA,UAjBW,WAiBX,EAAA,UAhBW,aAgBX,GAhB2B,eAgB3B,CAAA,CAAA,IAAA,EAdO,CAcP,EAAA,MAAA,EAbS,CAaT,EAAA,SAAA,EAZY,SAYZ,EAAA,QAAA,CAAA,EAXY,aAWZ,EAAA,GADO,oBACP,CAD4B,CAC5B,CAAA;AAjBW,cAmBC,mCAnBD,EAAA,CAAA,UAAA,EAoBE,UApBF,EAAA,MAAA,CAAA,EAqBF,aArBE,EAAA,QAAA,CAAA,EAuBC,aAvBD,EAAA,GAAA;EACA,OAAA,EAAA,GAAA;EAAgB,OAAA,CAAA,EAAA,MAAA;EAEpB,EAAA,CAAA,EAoBkB,iBAAA,CAAA,YApBlB;EACE,UAAA,CAAA,EAAA,MAAA,EAAA;EACG,OAAA,CAAA,qCAAA;EACA,QAAA,CAAA,uCAAA;EAUgB,MAAA,CAAA,oCAAA;EAArB,GAAA,iCAAA;EAAoB,KAAA,CAAA,EAAA,MAAA;EAGf,WAAA,CAAA,EAAA,MAAA;EACC,QAAA,CAAA,EAAA,MAAA,EAAA;EACJ,OAAA,CAAA,EAAA,MAAA;EAEG,QAAA,CAAA,EAAA,MAAA;EAAa,IAAA,CAAA,EAAA,MAAA,EAAA"}
1
+ {"version":3,"file":"getFilterTranslationsOnlyContent.d.ts","names":[],"sources":["../../../src/deepTransformPlugins/getFilterTranslationsOnlyContent.ts"],"sourcesContent":[],"mappings":";;;;;;;cAoCa,uCACH,0BACG,kBACV;;AAHH;;;;;AAuFa,cAAA,gCAkBZ,EAAA,CAAA,UAjBW,WAiBX,EAAA,UAhBW,aAgBX,GAhB2B,eAgB3B,CAAA,CAAA,IAAA,EAdO,CAcP,EAAA,MAAA,EAbS,CAaT,EAAA,SAAA,EAZY,SAYZ,EAAA,QAAA,CAAA,EAXY,aAWZ,EAAA,GADO,oBACP,CAD4B,CAC5B,CAAA;AAjBW,cAmBC,mCAnBD,EAAA,CAAA,UAAA,EAoBE,UApBF,EAAA,MAAA,CAAA,EAqBF,aArBE,EAAA,QAAA,CAAA,EAuBC,aAvBD,EAAA,GAAA;EACA,OAAA,EAAA,GAAA;EAAgB,OAAA,CAAA,EAAA,MAAA;EAEpB,EAAA,CAAA,EAoBkB,gBAAA,CAAA,YApBlB;EACE,UAAA,CAAA,EAAA,MAAA,EAAA;EACG,OAAA,CAAA,oCAAA;EACA,QAAA,CAAA,sCAAA;EAUgB,MAAA,CAAA,mCAAA;EAArB,GAAA,gCAAA;EAAoB,KAAA,CAAA,EAAA,MAAA;EAGf,WAAA,CAAA,EAAA,MAAA;EACC,QAAA,CAAA,EAAA,MAAA,EAAA;EACJ,OAAA,CAAA,EAAA,MAAA;EAEG,QAAA,CAAA,EAAA,MAAA;EAAa,IAAA,CAAA,EAAA,MAAA,EAAA"}
@@ -1,6 +1,6 @@
1
1
  import { NodeProps } from "../interpreter/getContent/plugins.js";
2
2
  import "../interpreter/index.js";
3
- import * as _intlayer_types6 from "@intlayer/types";
3
+ import * as _intlayer_types0 from "@intlayer/types";
4
4
  import { ContentNode, Dictionary, LocalesValues } from "@intlayer/types";
5
5
 
6
6
  //#region src/deepTransformPlugins/getFilteredLocalesContent.d.ts
@@ -8,12 +8,12 @@ declare const getFilteredLocalesContent: (node: ContentNode, locales: LocalesVal
8
8
  declare const getFilteredLocalesDictionary: (dictionary: Dictionary, locale: LocalesValues | LocalesValues[]) => {
9
9
  content: any;
10
10
  $schema?: string;
11
- id?: _intlayer_types6.DictionaryId;
11
+ id?: _intlayer_types0.DictionaryId;
12
12
  projectIds?: string[];
13
- localId?: _intlayer_types6.LocalDictionaryId;
14
- localIds?: _intlayer_types6.LocalDictionaryId[];
15
- format?: _intlayer_types6.DictionaryFormat;
16
- key: _intlayer_types6.DictionaryKey;
13
+ localId?: _intlayer_types0.LocalDictionaryId;
14
+ localIds?: _intlayer_types0.LocalDictionaryId[];
15
+ format?: _intlayer_types0.DictionaryFormat;
16
+ key: _intlayer_types0.DictionaryKey;
17
17
  title?: string;
18
18
  description?: string;
19
19
  versions?: string[];
@@ -21,11 +21,11 @@ declare const getFilteredLocalesDictionary: (dictionary: Dictionary, locale: Loc
21
21
  filePath?: string;
22
22
  tags?: string[];
23
23
  locale?: LocalesValues;
24
- fill?: _intlayer_types6.Fill;
24
+ fill?: _intlayer_types0.Fill;
25
25
  filled?: true;
26
26
  priority?: number;
27
27
  live?: boolean;
28
- location?: _intlayer_types6.DictionaryLocation;
28
+ location?: _intlayer_types0.DictionaryLocation;
29
29
  };
30
30
  //#endregion
31
31
  export { getFilteredLocalesContent, getFilteredLocalesDictionary };
@@ -1,4 +1,4 @@
1
- import * as _intlayer_types13 from "@intlayer/types";
1
+ import * as _intlayer_types20 from "@intlayer/types";
2
2
  import { Dictionary } from "@intlayer/types";
3
3
 
4
4
  //#region src/dictionaryManipulator/orderDictionaries.d.ts
@@ -10,7 +10,7 @@ import { Dictionary } from "@intlayer/types";
10
10
  * @param priorityStrategy - The priority strategy ('local_first' or 'distant_first')
11
11
  * @returns Ordered array of dictionaries
12
12
  */
13
- declare const orderDictionaries: (dictionaries: Dictionary[], configuration?: _intlayer_types13.IntlayerConfig) => Dictionary[];
13
+ declare const orderDictionaries: (dictionaries: Dictionary[], configuration?: _intlayer_types20.IntlayerConfig) => Dictionary[];
14
14
  //#endregion
15
15
  export { orderDictionaries };
16
16
  //# sourceMappingURL=orderDictionaries.d.ts.map
@@ -23,7 +23,7 @@ type TranslationContent<Content = unknown, RecordContent extends StrictModeLocal
23
23
  * - If a locale is missing, it will make each existing locale optional and raise an error if the locale is not found.
24
24
  */
25
25
  declare const translation: <Content = unknown, ContentRecord extends StrictModeLocaleMap<Content> = StrictModeLocaleMap<Content>>(content: ContentRecord) => TypedNodeModel<NodeType.Translation, ContentRecord, {
26
- nodeType: "translation" | NodeType.Translation;
26
+ nodeType: NodeType.Translation | "translation";
27
27
  } & {
28
28
  translation: ContentRecord;
29
29
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"translation.d.ts","names":[],"sources":["../../../../src/transpiler/translation/translation.ts"],"sourcesContent":[],"mappings":";;;KAOY,4DAGR,oBAAoB,WAAW,oBAAoB,YACnD,eAAe,QAAA,CAAS,aAAa;;AAJzC;;;;;;;;;AAIwD;;;;;;;;;;cAsBlD,WAKkB,EAAA,CAAA,UAAA,OAAA,EAAA,sBAFpB,mBAEoB,CAFA,OAEA,CAAA,GAFW,mBAEX,CAF+B,OAE/B,CAAA,CAAA,CAAA,OAAA,EAAb,aAAa,EAAA,GAAA,cAAA,CAAA,QAAA,CAAA,WAAA,EAAA,aAAA,EAAA;EAAA,QAAA,EAAA,aAAA,uBAAA"}
1
+ {"version":3,"file":"translation.d.ts","names":[],"sources":["../../../../src/transpiler/translation/translation.ts"],"sourcesContent":[],"mappings":";;;KAOY,4DAGR,oBAAoB,WAAW,oBAAoB,YACnD,eAAe,QAAA,CAAS,aAAa;;AAJzC;;;;;;;;;AAIwD;;;;;;;;;;cAsBlD,WAKkB,EAAA,CAAA,UAAA,OAAA,EAAA,sBAFpB,mBAEoB,CAFA,OAEA,CAAA,GAFW,mBAEX,CAF+B,OAE/B,CAAA,CAAA,CAAA,OAAA,EAAb,aAAa,EAAA,GAAA,cAAA,CAAA,QAAA,CAAA,WAAA,EAAA,aAAA,EAAA;EAAA,QAAA,sBAAA,GAAA,aAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"intl.d.ts","names":[],"sources":["../../../src/utils/intl.ts"],"sourcesContent":[],"mappings":";;;KA6BK,gBAAA,wBACgB,gBAAgB,MAAM,yCAGrC,oBACgB,MAAM,IAVkC;KAczD,8BARgB,CAAA,CAAA,CAAA,GAQoB,CARpB,UAAA,KAAA,OAAA,EAAA,GAAA,EAAA,OAAA,CAAA,EAAA,KAAA,QAAA,EAAA,GAAA,KAAA,SAAA,IAAA,KAAA,OAAA,CAAA,EAaL,aAbK,EAAA,OAAA,CAAA,EAcL,OAdK,EAAA,GAeZ,QAfY,GAgBjB,CAhBiB,UAAA,KAAA,OAAA,EAAA,GAAA,EAAA,GAAA,KAAA,SAAA,IAAA,KAAA,OAAA,CAAA,EAoBH,aApBG,EAAA,GAqBV,QArBU,GAsBf,CAtBe;KAyBhB,WAAA,GAzBgC,QAAM,MAAA,OA0BtB,IA1BsB,GA0Bf,CA1Be,SAAA,MA0BC,gBA1BD,GA2BrC,8BA3BqC,CAAA,CAAA,OA2BE,IA3BF,CAAA,CA2BQ,CA3BR,CAAA,CAAA,GAAA,CAAA,OA4B7B,IA5B6B,CAAA,CA4BvB,CA5BuB,CAAA,EAGrC;AACgB,cA0FT,gBA1FS,EAAA,GAAA,GA0Fc,WA1Fd;AAAM,cAuGf,UAvGe,EAuGL,WAvGK"}
1
+ {"version":3,"file":"intl.d.ts","names":[],"sources":["../../../src/utils/intl.ts"],"sourcesContent":[],"mappings":";;;KA6BK,gBAAA,wBACgB,gBAAgB,MAAM,yCAGrC,oBACgB,MAAM,IAVkC;KAczD,8BARgB,CAAA,CAAA,CAAA,GAQoB,CARpB,UAAA,KAAA,OAAA,EAAA,GAAA,EAAA,OAAA,CAAA,EAAA,KAAA,QAAA,EAAA,GAAA,KAAA,SAAA,IAAA,KAAA,OAAA,CAAA,EAaL,aAbK,EAAA,OAAA,CAAA,EAcL,OAdK,EAAA,GAeZ,QAfY,GAgBjB,CAhBiB,UAAA,KAAA,OAAA,EAAA,GAAA,EAAA,GAAA,KAAA,SAAA,IAAA,KAAA,OAAA,CAAA,EAoBH,aApBG,EAAA,GAqBV,QArBU,GAsBf,CAtBe;KAyBhB,WAAA,GAzBgC,QAAM,MAAA,OA0BtB,IA1BsB,GA0Bf,CA1Be,SAAA,MA0BC,gBA1BD,GA2BrC,8BA3BqC,CAAA,CAAA,OA2BE,IA3BF,CAAA,CA2BQ,CA3BR,CAAA,CAAA,GAAA,CAAA,OA4B7B,IA5B6B,CAAA,CA4BvB,CA5BuB,CAAA,EAGrC;AACgB,cA2FT,gBA3FS,EAAA,GAAA,GA2Fc,WA3Fd;AAAM,cAwGf,UAxGe,EAwGL,WAxGK"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/core",
3
- "version": "7.5.0",
3
+ "version": "7.5.1",
4
4
  "private": false,
5
5
  "description": "Includes core Intlayer functions like translation, dictionary, and utility functions shared across multiple packages.",
6
6
  "keywords": [
@@ -107,11 +107,11 @@
107
107
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
108
108
  },
109
109
  "dependencies": {
110
- "@intlayer/api": "7.5.0",
111
- "@intlayer/config": "7.5.0",
112
- "@intlayer/dictionaries-entry": "7.5.0",
113
- "@intlayer/types": "7.5.0",
114
- "@intlayer/unmerged-dictionaries-entry": "7.5.0",
110
+ "@intlayer/api": "7.5.1",
111
+ "@intlayer/config": "7.5.1",
112
+ "@intlayer/dictionaries-entry": "7.5.1",
113
+ "@intlayer/types": "7.5.1",
114
+ "@intlayer/unmerged-dictionaries-entry": "7.5.1",
115
115
  "defu": "6.1.4"
116
116
  },
117
117
  "devDependencies": {