@intlayer/core 3.5.1 → 3.5.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.
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var getLocalizedUrl_exports = {};
20
+ __export(getLocalizedUrl_exports, {
21
+ getLocalizedUrl: () => getLocalizedUrl
22
+ });
23
+ module.exports = __toCommonJS(getLocalizedUrl_exports);
24
+ var import_client = require("@intlayer/config/client");
25
+ var import_getMultilingualUrls = require('./getMultilingualUrls.cjs');
26
+ const { internationalization, middleware } = (0, import_client.getConfiguration)();
27
+ const { locales: localesDefault, defaultLocale: defaultLocaleDefault } = internationalization;
28
+ const { prefixDefault: prefixDefaultDefault } = middleware;
29
+ const getLocalizedUrl = (url, currentLocale, locales = localesDefault, defaultLocale = defaultLocaleDefault, prefixDefault = prefixDefaultDefault) => {
30
+ const urlWithoutLocale = (0, import_getMultilingualUrls.getMultilingualUrls)(
31
+ url,
32
+ locales,
33
+ defaultLocale,
34
+ prefixDefault
35
+ );
36
+ return urlWithoutLocale[currentLocale];
37
+ };
38
+ // Annotate the CommonJS export names for ESM import in node:
39
+ 0 && (module.exports = {
40
+ getLocalizedUrl
41
+ });
42
+ //# sourceMappingURL=getLocalizedUrl.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/getLocalizedUrl.ts"],"sourcesContent":["import { getConfiguration, Locales } from '@intlayer/config/client';\nimport { getMultilingualUrls } from './getMultilingualUrls';\n\n// Destructure necessary configurations\nconst { internationalization, middleware } = getConfiguration();\nconst { locales: localesDefault, defaultLocale: defaultLocaleDefault } =\n internationalization;\nconst { prefixDefault: prefixDefaultDefault } = middleware;\n\n/**\n * Generate URL by prefixing the given URL with the referenced locale.\n * Handles both absolute and relative URLs appropriately.\n *\n * This function get the locales, default locale, and prefix default from the configuration if not provided.\n *\n * Example:\n *\n * ```ts\n * getCurrentUrl('/about', currentLocale, ['en', 'fr'], 'en', false);\n * // Returns '/fr/about' for the French locale\n * // Returns '/about' for the default locale\n * // Returns '/about' for the Italian locale\n *\n * getCurrentUrl('https://example.com/about', currentLocale, ['en', 'fr'], 'en', false);\n * // Returns 'https://example.com/fr/about' for the French locale\n * // Returns 'https://example.com/about' for the default locale\n * // Returns 'https://example.com/about' for the Italian locale\n * ```\n *\n * @param url - The original URL string to be prefixed with locales.\n * @param currentLocale - The current locale.\n * @param locales - Optional array of supported locales. Defaults to `localesDefault`.\n * @param defaultLocale - The default locale. Defaults to `defaultLocaleDefault`.\n * @param prefixDefault - Whether to prefix the default locale. Defaults to `prefixDefaultDefault`.\n * @returns An object mapping each locale to its corresponding multilingual URL.\n */\nexport const getLocalizedUrl = (\n url: string,\n currentLocale: Locales,\n locales: Locales[] = localesDefault,\n defaultLocale: Locales = defaultLocaleDefault,\n prefixDefault: boolean = prefixDefaultDefault\n): string => {\n // Remove any existing locale segment from the URL\n const urlWithoutLocale = getMultilingualUrls(\n url,\n locales,\n defaultLocale,\n prefixDefault\n );\n\n return urlWithoutLocale[\n currentLocale as unknown as keyof typeof urlWithoutLocale\n ];\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA0C;AAC1C,iCAAoC;AAGpC,MAAM,EAAE,sBAAsB,WAAW,QAAI,gCAAiB;AAC9D,MAAM,EAAE,SAAS,gBAAgB,eAAe,qBAAqB,IACnE;AACF,MAAM,EAAE,eAAe,qBAAqB,IAAI;AA6BzC,MAAM,kBAAkB,CAC7B,KACA,eACA,UAAqB,gBACrB,gBAAyB,sBACzB,gBAAyB,yBACd;AAEX,QAAM,uBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO,iBACL,aACF;AACF;","names":[]}
@@ -27,7 +27,6 @@ var import_client = require("@intlayer/config/client");
27
27
  const { internationalization } = (0, import_client.getConfiguration)();
28
28
  const { locales: localesDefault } = internationalization;
29
29
  const removeLocaleFromUrl = (inputUrl, locales = localesDefault) => {
30
- console.log("inputUrl", inputUrl);
31
30
  const url = new URL(inputUrl);
32
31
  const pathname = url.pathname;
33
32
  if (!pathname.startsWith("/")) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/getPathWithoutLocale.ts"],"sourcesContent":["import { getConfiguration, type Locales } from '@intlayer/config/client';\n\nconst { internationalization } = getConfiguration();\nconst { locales: localesDefault } = internationalization;\n\n/**\n * Removes the locale segment from the given URL if present.\n *\n * This function get the locales from the configuration if not provided.\n *\n * Example:\n *\n * ```ts\n * removeLocaleFromUrl('https://example.com/en/dashboard') // Returns 'https://example.com/dashboard'\n * removeLocaleFromUrl('https://example.com/fr/dashboard') // Returns 'https://example.com/fr/dashboard'\n * removeLocaleFromUrl('https://example.com/dashboard') // Returns 'https://example.com/dashboard'\n * ```\n *\n * @param inputUrl - The complete URL string to process.\n * @param locales - Optional array of supported locales. Defaults to `localesDefault`.\n * @returns The URL string without the locale segment.\n */\nexport const removeLocaleFromUrl = (\n inputUrl: string,\n locales: Locales[] = localesDefault\n): string => {\n console.log('inputUrl', inputUrl);\n // Parse the input URL\n const url = new URL(inputUrl);\n\n const pathname = url.pathname;\n\n // Ensure the pathname starts with '/'\n if (!pathname.startsWith('/')) {\n // If not, return the URL as is\n url.pathname = `/${pathname}`;\n }\n\n // Split the pathname to extract the first segment\n const pathSegments = pathname.split('/');\n const firstSegment = pathSegments[1]; // The segment after the first '/'\n\n // Check if the first segment is a supported locale\n if (locales.includes(firstSegment as Locales)) {\n // Remove the locale segment from the pathname\n pathSegments.splice(1, 1); // Remove the first segment\n\n // Reconstruct the pathname\n const newPathname = pathSegments.join('/') ?? '/';\n url.pathname = newPathname;\n }\n\n // Return the modified URL as a string\n return url.toString();\n};\n\n/**\n * Removes the locale segment from the given URL or pathname if present.\n *\n * This function get the locales from the configuration if not provided.\n *\n * Example:\n *\n * ```ts\n * getPathWithoutLocale('/en/dashboard') // Returns '/dashboard'\n * getPathWithoutLocale('/fr/dashboard') // Returns '/dashboard'\n * getPathWithoutLocale('/dashboard') // Returns '/dashboard'\n * getPathWithoutLocale('dashboard') // Returns 'dashboard'\n * getPathWithoutLocale('https://example.com/en/dashboard') // Returns 'https://example.com/dashboard'\n * getPathWithoutLocale('https://example.com/fr/dashboard') // Returns 'https://example.com/dashboard'\n * getPathWithoutLocale('https://example.com/dashboard') // Returns 'https://example.com/dashboard'\n * ```\n *\n * @param inputUrl - The complete URL string or pathname to process.\n * @param locales - Optional array of supported locales. Defaults to `localesDefault`.\n * @returns The URL string or pathname without the locale segment.\n */\nexport const getPathWithoutLocale = (\n inputUrl: string,\n locales: Locales[] = localesDefault\n): string => {\n // Determine if the input is an absolute URL\n const isAbsoluteUrl = checkIsAbsoluteUrl(inputUrl);\n\n // If it's an absolute URL, parse it using the URL constructor\n // Otherwise, handle it as a relative pathname\n const url = isAbsoluteUrl\n ? new URL(inputUrl)\n : new URL(inputUrl, 'http://example.com');\n\n const urlWithoutLocale = removeLocaleFromUrl(url.toString(), locales);\n\n if (isAbsoluteUrl) {\n // If the input was an absolute URL, return the modified URL as a string\n return urlWithoutLocale;\n }\n\n // If the input was a relative pathname, return the modified pathname\n return urlWithoutLocale.replace('http://example.com', '');\n};\n\nexport const checkIsAbsoluteUrl = (url: string): boolean =>\n /^[a-zA-Z][a-zA-Z\\d+\\-.]*:/.test(url);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA+C;AAE/C,MAAM,EAAE,qBAAqB,QAAI,gCAAiB;AAClD,MAAM,EAAE,SAAS,eAAe,IAAI;AAmB7B,MAAM,sBAAsB,CACjC,UACA,UAAqB,mBACV;AACX,UAAQ,IAAI,YAAY,QAAQ;AAEhC,QAAM,MAAM,IAAI,IAAI,QAAQ;AAE5B,QAAM,WAAW,IAAI;AAGrB,MAAI,CAAC,SAAS,WAAW,GAAG,GAAG;AAE7B,QAAI,WAAW,IAAI,QAAQ;AAAA,EAC7B;AAGA,QAAM,eAAe,SAAS,MAAM,GAAG;AACvC,QAAM,eAAe,aAAa,CAAC;AAGnC,MAAI,QAAQ,SAAS,YAAuB,GAAG;AAE7C,iBAAa,OAAO,GAAG,CAAC;AAGxB,UAAM,cAAc,aAAa,KAAK,GAAG,KAAK;AAC9C,QAAI,WAAW;AAAA,EACjB;AAGA,SAAO,IAAI,SAAS;AACtB;AAuBO,MAAM,uBAAuB,CAClC,UACA,UAAqB,mBACV;AAEX,QAAM,gBAAgB,mBAAmB,QAAQ;AAIjD,QAAM,MAAM,gBACR,IAAI,IAAI,QAAQ,IAChB,IAAI,IAAI,UAAU,oBAAoB;AAE1C,QAAM,mBAAmB,oBAAoB,IAAI,SAAS,GAAG,OAAO;AAEpE,MAAI,eAAe;AAEjB,WAAO;AAAA,EACT;AAGA,SAAO,iBAAiB,QAAQ,sBAAsB,EAAE;AAC1D;AAEO,MAAM,qBAAqB,CAAC,QACjC,4BAA4B,KAAK,GAAG;","names":[]}
1
+ {"version":3,"sources":["../../src/getPathWithoutLocale.ts"],"sourcesContent":["import { getConfiguration, type Locales } from '@intlayer/config/client';\n\nconst { internationalization } = getConfiguration();\nconst { locales: localesDefault } = internationalization;\n\n/**\n * Removes the locale segment from the given URL if present.\n *\n * This function get the locales from the configuration if not provided.\n *\n * Example:\n *\n * ```ts\n * removeLocaleFromUrl('https://example.com/en/dashboard') // Returns 'https://example.com/dashboard'\n * removeLocaleFromUrl('https://example.com/fr/dashboard') // Returns 'https://example.com/fr/dashboard'\n * removeLocaleFromUrl('https://example.com/dashboard') // Returns 'https://example.com/dashboard'\n * ```\n *\n * @param inputUrl - The complete URL string to process.\n * @param locales - Optional array of supported locales. Defaults to `localesDefault`.\n * @returns The URL string without the locale segment.\n */\nexport const removeLocaleFromUrl = (\n inputUrl: string,\n locales: Locales[] = localesDefault\n): string => {\n // Parse the input URL\n const url = new URL(inputUrl);\n\n const pathname = url.pathname;\n\n // Ensure the pathname starts with '/'\n if (!pathname.startsWith('/')) {\n // If not, return the URL as is\n url.pathname = `/${pathname}`;\n }\n\n // Split the pathname to extract the first segment\n const pathSegments = pathname.split('/');\n const firstSegment = pathSegments[1]; // The segment after the first '/'\n\n // Check if the first segment is a supported locale\n if (locales.includes(firstSegment as Locales)) {\n // Remove the locale segment from the pathname\n pathSegments.splice(1, 1); // Remove the first segment\n\n // Reconstruct the pathname\n const newPathname = pathSegments.join('/') ?? '/';\n url.pathname = newPathname;\n }\n\n // Return the modified URL as a string\n return url.toString();\n};\n\n/**\n * Removes the locale segment from the given URL or pathname if present.\n *\n * This function get the locales from the configuration if not provided.\n *\n * Example:\n *\n * ```ts\n * getPathWithoutLocale('/en/dashboard') // Returns '/dashboard'\n * getPathWithoutLocale('/fr/dashboard') // Returns '/dashboard'\n * getPathWithoutLocale('/dashboard') // Returns '/dashboard'\n * getPathWithoutLocale('dashboard') // Returns 'dashboard'\n * getPathWithoutLocale('https://example.com/en/dashboard') // Returns 'https://example.com/dashboard'\n * getPathWithoutLocale('https://example.com/fr/dashboard') // Returns 'https://example.com/dashboard'\n * getPathWithoutLocale('https://example.com/dashboard') // Returns 'https://example.com/dashboard'\n * ```\n *\n * @param inputUrl - The complete URL string or pathname to process.\n * @param locales - Optional array of supported locales. Defaults to `localesDefault`.\n * @returns The URL string or pathname without the locale segment.\n */\nexport const getPathWithoutLocale = (\n inputUrl: string,\n locales: Locales[] = localesDefault\n): string => {\n // Determine if the input is an absolute URL\n const isAbsoluteUrl = checkIsAbsoluteUrl(inputUrl);\n\n // If it's an absolute URL, parse it using the URL constructor\n // Otherwise, handle it as a relative pathname\n const url = isAbsoluteUrl\n ? new URL(inputUrl)\n : new URL(inputUrl, 'http://example.com');\n\n const urlWithoutLocale = removeLocaleFromUrl(url.toString(), locales);\n\n if (isAbsoluteUrl) {\n // If the input was an absolute URL, return the modified URL as a string\n return urlWithoutLocale;\n }\n\n // If the input was a relative pathname, return the modified pathname\n return urlWithoutLocale.replace('http://example.com', '');\n};\n\nexport const checkIsAbsoluteUrl = (url: string): boolean =>\n /^[a-zA-Z][a-zA-Z\\d+\\-.]*:/.test(url);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA+C;AAE/C,MAAM,EAAE,qBAAqB,QAAI,gCAAiB;AAClD,MAAM,EAAE,SAAS,eAAe,IAAI;AAmB7B,MAAM,sBAAsB,CACjC,UACA,UAAqB,mBACV;AAEX,QAAM,MAAM,IAAI,IAAI,QAAQ;AAE5B,QAAM,WAAW,IAAI;AAGrB,MAAI,CAAC,SAAS,WAAW,GAAG,GAAG;AAE7B,QAAI,WAAW,IAAI,QAAQ;AAAA,EAC7B;AAGA,QAAM,eAAe,SAAS,MAAM,GAAG;AACvC,QAAM,eAAe,aAAa,CAAC;AAGnC,MAAI,QAAQ,SAAS,YAAuB,GAAG;AAE7C,iBAAa,OAAO,GAAG,CAAC;AAGxB,UAAM,cAAc,aAAa,KAAK,GAAG,KAAK;AAC9C,QAAI,WAAW;AAAA,EACjB;AAGA,SAAO,IAAI,SAAS;AACtB;AAuBO,MAAM,uBAAuB,CAClC,UACA,UAAqB,mBACV;AAEX,QAAM,gBAAgB,mBAAmB,QAAQ;AAIjD,QAAM,MAAM,gBACR,IAAI,IAAI,QAAQ,IAChB,IAAI,IAAI,UAAU,oBAAoB;AAE1C,QAAM,mBAAmB,oBAAoB,IAAI,SAAS,GAAG,OAAO;AAEpE,MAAI,eAAe;AAEjB,WAAO;AAAA,EACT;AAGA,SAAO,iBAAiB,QAAQ,sBAAsB,EAAE;AAC1D;AAEO,MAAM,qBAAqB,CAAC,QACjC,4BAA4B,KAAK,GAAG;","names":[]}
@@ -25,6 +25,7 @@ __export(src_exports, {
25
25
  getHTMLLang: () => import_getHTMLLang.getHTMLLang,
26
26
  getHTMLTextDir: () => import_getHTMLTextDir.getHTMLTextDir,
27
27
  getLocaleName: () => import_getLocaleName.getLocaleName,
28
+ getLocalizedUrl: () => import_getLocalizedUrl.getLocalizedUrl,
28
29
  getMultilingualUrls: () => import_getMultilingualUrls.getMultilingualUrls,
29
30
  getPathWithoutLocale: () => import_getPathWithoutLocale.getPathWithoutLocale,
30
31
  getTranslationContent: () => import_content_transformers.getTranslationContent,
@@ -44,6 +45,7 @@ var import_isSameKeyPath = require('./utils/isSameKeyPath.cjs');
44
45
  var import_localeDetector = require('./localeDetector.cjs');
45
46
  var import_getPathWithoutLocale = require('./getPathWithoutLocale.cjs');
46
47
  var import_getMultilingualUrls = require('./getMultilingualUrls.cjs');
48
+ var import_getLocalizedUrl = require('./getLocalizedUrl.cjs');
47
49
  // Annotate the CommonJS export names for ESM import in node:
48
50
  0 && (module.exports = {
49
51
  NodeType,
@@ -53,6 +55,7 @@ var import_getMultilingualUrls = require('./getMultilingualUrls.cjs');
53
55
  getHTMLLang,
54
56
  getHTMLTextDir,
55
57
  getLocaleName,
58
+ getLocalizedUrl,
56
59
  getMultilingualUrls,
57
60
  getPathWithoutLocale,
58
61
  getTranslationContent,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export type {\n CustomizableLanguageContent,\n LanguageContent,\n TranslationContent,\n EnumerationContent,\n QuantityContent,\n CustomLocales as Locales,\n} from './transpiler/content_transformers/index';\nexport {\n t,\n enu,\n getTranslationContent,\n findMatchingCondition,\n getEnumerationContent,\n} from './transpiler/content_transformers/index';\nexport type {\n ContentValue,\n Content,\n FlatContentValue,\n FlatContent,\n TypedNode,\n DeclarationContent,\n KeyPath,\n ObjectNode,\n ArrayNode,\n RecursiveDictionaryValue,\n TranslationNode,\n EnumerationNode,\n DictionaryValue,\n Dictionary,\n} from './types/index';\nexport { NodeType } from './types/index';\nexport { getLocaleName } from './getLocaleName';\nexport { getHTMLTextDir } from './getHTMLTextDir';\nexport { getHTMLLang } from './getHTMLLang';\nexport { localeList } from './localeList';\nexport { isSameKeyPath } from './utils/isSameKeyPath';\nexport { localeDetector } from './localeDetector';\nexport { getPathWithoutLocale } from './getPathWithoutLocale';\nexport { getMultilingualUrls } from './getMultilingualUrls';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,kCAMO;AAiBP,mBAAyB;AACzB,2BAA8B;AAC9B,4BAA+B;AAC/B,yBAA4B;AAC5B,wBAA2B;AAC3B,2BAA8B;AAC9B,4BAA+B;AAC/B,kCAAqC;AACrC,iCAAoC;","names":[]}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export type {\n CustomizableLanguageContent,\n LanguageContent,\n TranslationContent,\n EnumerationContent,\n QuantityContent,\n CustomLocales as Locales,\n} from './transpiler/content_transformers/index';\nexport {\n t,\n enu,\n getTranslationContent,\n findMatchingCondition,\n getEnumerationContent,\n} from './transpiler/content_transformers/index';\nexport type {\n ContentValue,\n Content,\n FlatContentValue,\n FlatContent,\n TypedNode,\n DeclarationContent,\n KeyPath,\n ObjectNode,\n ArrayNode,\n RecursiveDictionaryValue,\n TranslationNode,\n EnumerationNode,\n DictionaryValue,\n Dictionary,\n} from './types/index';\nexport { NodeType } from './types/index';\nexport { getLocaleName } from './getLocaleName';\nexport { getHTMLTextDir } from './getHTMLTextDir';\nexport { getHTMLLang } from './getHTMLLang';\nexport { localeList } from './localeList';\nexport { isSameKeyPath } from './utils/isSameKeyPath';\nexport { localeDetector } from './localeDetector';\nexport { getPathWithoutLocale } from './getPathWithoutLocale';\nexport { getMultilingualUrls } from './getMultilingualUrls';\nexport { getLocalizedUrl } from './getLocalizedUrl';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,kCAMO;AAiBP,mBAAyB;AACzB,2BAA8B;AAC9B,4BAA+B;AAC/B,yBAA4B;AAC5B,wBAA2B;AAC3B,2BAA8B;AAC9B,4BAA+B;AAC/B,kCAAqC;AACrC,iCAAoC;AACpC,6BAAgC;","names":[]}
@@ -0,0 +1,18 @@
1
+ import { getConfiguration } from "@intlayer/config/client";
2
+ import { getMultilingualUrls } from './getMultilingualUrls.mjs';
3
+ const { internationalization, middleware } = getConfiguration();
4
+ const { locales: localesDefault, defaultLocale: defaultLocaleDefault } = internationalization;
5
+ const { prefixDefault: prefixDefaultDefault } = middleware;
6
+ const getLocalizedUrl = (url, currentLocale, locales = localesDefault, defaultLocale = defaultLocaleDefault, prefixDefault = prefixDefaultDefault) => {
7
+ const urlWithoutLocale = getMultilingualUrls(
8
+ url,
9
+ locales,
10
+ defaultLocale,
11
+ prefixDefault
12
+ );
13
+ return urlWithoutLocale[currentLocale];
14
+ };
15
+ export {
16
+ getLocalizedUrl
17
+ };
18
+ //# sourceMappingURL=getLocalizedUrl.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/getLocalizedUrl.ts"],"sourcesContent":["import { getConfiguration, Locales } from '@intlayer/config/client';\nimport { getMultilingualUrls } from './getMultilingualUrls';\n\n// Destructure necessary configurations\nconst { internationalization, middleware } = getConfiguration();\nconst { locales: localesDefault, defaultLocale: defaultLocaleDefault } =\n internationalization;\nconst { prefixDefault: prefixDefaultDefault } = middleware;\n\n/**\n * Generate URL by prefixing the given URL with the referenced locale.\n * Handles both absolute and relative URLs appropriately.\n *\n * This function get the locales, default locale, and prefix default from the configuration if not provided.\n *\n * Example:\n *\n * ```ts\n * getCurrentUrl('/about', currentLocale, ['en', 'fr'], 'en', false);\n * // Returns '/fr/about' for the French locale\n * // Returns '/about' for the default locale\n * // Returns '/about' for the Italian locale\n *\n * getCurrentUrl('https://example.com/about', currentLocale, ['en', 'fr'], 'en', false);\n * // Returns 'https://example.com/fr/about' for the French locale\n * // Returns 'https://example.com/about' for the default locale\n * // Returns 'https://example.com/about' for the Italian locale\n * ```\n *\n * @param url - The original URL string to be prefixed with locales.\n * @param currentLocale - The current locale.\n * @param locales - Optional array of supported locales. Defaults to `localesDefault`.\n * @param defaultLocale - The default locale. Defaults to `defaultLocaleDefault`.\n * @param prefixDefault - Whether to prefix the default locale. Defaults to `prefixDefaultDefault`.\n * @returns An object mapping each locale to its corresponding multilingual URL.\n */\nexport const getLocalizedUrl = (\n url: string,\n currentLocale: Locales,\n locales: Locales[] = localesDefault,\n defaultLocale: Locales = defaultLocaleDefault,\n prefixDefault: boolean = prefixDefaultDefault\n): string => {\n // Remove any existing locale segment from the URL\n const urlWithoutLocale = getMultilingualUrls(\n url,\n locales,\n defaultLocale,\n prefixDefault\n );\n\n return urlWithoutLocale[\n currentLocale as unknown as keyof typeof urlWithoutLocale\n ];\n};\n"],"mappings":"AAAA,SAAS,wBAAiC;AAC1C,SAAS,2BAA2B;AAGpC,MAAM,EAAE,sBAAsB,WAAW,IAAI,iBAAiB;AAC9D,MAAM,EAAE,SAAS,gBAAgB,eAAe,qBAAqB,IACnE;AACF,MAAM,EAAE,eAAe,qBAAqB,IAAI;AA6BzC,MAAM,kBAAkB,CAC7B,KACA,eACA,UAAqB,gBACrB,gBAAyB,sBACzB,gBAAyB,yBACd;AAEX,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO,iBACL,aACF;AACF;","names":[]}
@@ -2,7 +2,6 @@ import { getConfiguration } from "@intlayer/config/client";
2
2
  const { internationalization } = getConfiguration();
3
3
  const { locales: localesDefault } = internationalization;
4
4
  const removeLocaleFromUrl = (inputUrl, locales = localesDefault) => {
5
- console.log("inputUrl", inputUrl);
6
5
  const url = new URL(inputUrl);
7
6
  const pathname = url.pathname;
8
7
  if (!pathname.startsWith("/")) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/getPathWithoutLocale.ts"],"sourcesContent":["import { getConfiguration, type Locales } from '@intlayer/config/client';\n\nconst { internationalization } = getConfiguration();\nconst { locales: localesDefault } = internationalization;\n\n/**\n * Removes the locale segment from the given URL if present.\n *\n * This function get the locales from the configuration if not provided.\n *\n * Example:\n *\n * ```ts\n * removeLocaleFromUrl('https://example.com/en/dashboard') // Returns 'https://example.com/dashboard'\n * removeLocaleFromUrl('https://example.com/fr/dashboard') // Returns 'https://example.com/fr/dashboard'\n * removeLocaleFromUrl('https://example.com/dashboard') // Returns 'https://example.com/dashboard'\n * ```\n *\n * @param inputUrl - The complete URL string to process.\n * @param locales - Optional array of supported locales. Defaults to `localesDefault`.\n * @returns The URL string without the locale segment.\n */\nexport const removeLocaleFromUrl = (\n inputUrl: string,\n locales: Locales[] = localesDefault\n): string => {\n console.log('inputUrl', inputUrl);\n // Parse the input URL\n const url = new URL(inputUrl);\n\n const pathname = url.pathname;\n\n // Ensure the pathname starts with '/'\n if (!pathname.startsWith('/')) {\n // If not, return the URL as is\n url.pathname = `/${pathname}`;\n }\n\n // Split the pathname to extract the first segment\n const pathSegments = pathname.split('/');\n const firstSegment = pathSegments[1]; // The segment after the first '/'\n\n // Check if the first segment is a supported locale\n if (locales.includes(firstSegment as Locales)) {\n // Remove the locale segment from the pathname\n pathSegments.splice(1, 1); // Remove the first segment\n\n // Reconstruct the pathname\n const newPathname = pathSegments.join('/') ?? '/';\n url.pathname = newPathname;\n }\n\n // Return the modified URL as a string\n return url.toString();\n};\n\n/**\n * Removes the locale segment from the given URL or pathname if present.\n *\n * This function get the locales from the configuration if not provided.\n *\n * Example:\n *\n * ```ts\n * getPathWithoutLocale('/en/dashboard') // Returns '/dashboard'\n * getPathWithoutLocale('/fr/dashboard') // Returns '/dashboard'\n * getPathWithoutLocale('/dashboard') // Returns '/dashboard'\n * getPathWithoutLocale('dashboard') // Returns 'dashboard'\n * getPathWithoutLocale('https://example.com/en/dashboard') // Returns 'https://example.com/dashboard'\n * getPathWithoutLocale('https://example.com/fr/dashboard') // Returns 'https://example.com/dashboard'\n * getPathWithoutLocale('https://example.com/dashboard') // Returns 'https://example.com/dashboard'\n * ```\n *\n * @param inputUrl - The complete URL string or pathname to process.\n * @param locales - Optional array of supported locales. Defaults to `localesDefault`.\n * @returns The URL string or pathname without the locale segment.\n */\nexport const getPathWithoutLocale = (\n inputUrl: string,\n locales: Locales[] = localesDefault\n): string => {\n // Determine if the input is an absolute URL\n const isAbsoluteUrl = checkIsAbsoluteUrl(inputUrl);\n\n // If it's an absolute URL, parse it using the URL constructor\n // Otherwise, handle it as a relative pathname\n const url = isAbsoluteUrl\n ? new URL(inputUrl)\n : new URL(inputUrl, 'http://example.com');\n\n const urlWithoutLocale = removeLocaleFromUrl(url.toString(), locales);\n\n if (isAbsoluteUrl) {\n // If the input was an absolute URL, return the modified URL as a string\n return urlWithoutLocale;\n }\n\n // If the input was a relative pathname, return the modified pathname\n return urlWithoutLocale.replace('http://example.com', '');\n};\n\nexport const checkIsAbsoluteUrl = (url: string): boolean =>\n /^[a-zA-Z][a-zA-Z\\d+\\-.]*:/.test(url);\n"],"mappings":"AAAA,SAAS,wBAAsC;AAE/C,MAAM,EAAE,qBAAqB,IAAI,iBAAiB;AAClD,MAAM,EAAE,SAAS,eAAe,IAAI;AAmB7B,MAAM,sBAAsB,CACjC,UACA,UAAqB,mBACV;AACX,UAAQ,IAAI,YAAY,QAAQ;AAEhC,QAAM,MAAM,IAAI,IAAI,QAAQ;AAE5B,QAAM,WAAW,IAAI;AAGrB,MAAI,CAAC,SAAS,WAAW,GAAG,GAAG;AAE7B,QAAI,WAAW,IAAI,QAAQ;AAAA,EAC7B;AAGA,QAAM,eAAe,SAAS,MAAM,GAAG;AACvC,QAAM,eAAe,aAAa,CAAC;AAGnC,MAAI,QAAQ,SAAS,YAAuB,GAAG;AAE7C,iBAAa,OAAO,GAAG,CAAC;AAGxB,UAAM,cAAc,aAAa,KAAK,GAAG,KAAK;AAC9C,QAAI,WAAW;AAAA,EACjB;AAGA,SAAO,IAAI,SAAS;AACtB;AAuBO,MAAM,uBAAuB,CAClC,UACA,UAAqB,mBACV;AAEX,QAAM,gBAAgB,mBAAmB,QAAQ;AAIjD,QAAM,MAAM,gBACR,IAAI,IAAI,QAAQ,IAChB,IAAI,IAAI,UAAU,oBAAoB;AAE1C,QAAM,mBAAmB,oBAAoB,IAAI,SAAS,GAAG,OAAO;AAEpE,MAAI,eAAe;AAEjB,WAAO;AAAA,EACT;AAGA,SAAO,iBAAiB,QAAQ,sBAAsB,EAAE;AAC1D;AAEO,MAAM,qBAAqB,CAAC,QACjC,4BAA4B,KAAK,GAAG;","names":[]}
1
+ {"version":3,"sources":["../../src/getPathWithoutLocale.ts"],"sourcesContent":["import { getConfiguration, type Locales } from '@intlayer/config/client';\n\nconst { internationalization } = getConfiguration();\nconst { locales: localesDefault } = internationalization;\n\n/**\n * Removes the locale segment from the given URL if present.\n *\n * This function get the locales from the configuration if not provided.\n *\n * Example:\n *\n * ```ts\n * removeLocaleFromUrl('https://example.com/en/dashboard') // Returns 'https://example.com/dashboard'\n * removeLocaleFromUrl('https://example.com/fr/dashboard') // Returns 'https://example.com/fr/dashboard'\n * removeLocaleFromUrl('https://example.com/dashboard') // Returns 'https://example.com/dashboard'\n * ```\n *\n * @param inputUrl - The complete URL string to process.\n * @param locales - Optional array of supported locales. Defaults to `localesDefault`.\n * @returns The URL string without the locale segment.\n */\nexport const removeLocaleFromUrl = (\n inputUrl: string,\n locales: Locales[] = localesDefault\n): string => {\n // Parse the input URL\n const url = new URL(inputUrl);\n\n const pathname = url.pathname;\n\n // Ensure the pathname starts with '/'\n if (!pathname.startsWith('/')) {\n // If not, return the URL as is\n url.pathname = `/${pathname}`;\n }\n\n // Split the pathname to extract the first segment\n const pathSegments = pathname.split('/');\n const firstSegment = pathSegments[1]; // The segment after the first '/'\n\n // Check if the first segment is a supported locale\n if (locales.includes(firstSegment as Locales)) {\n // Remove the locale segment from the pathname\n pathSegments.splice(1, 1); // Remove the first segment\n\n // Reconstruct the pathname\n const newPathname = pathSegments.join('/') ?? '/';\n url.pathname = newPathname;\n }\n\n // Return the modified URL as a string\n return url.toString();\n};\n\n/**\n * Removes the locale segment from the given URL or pathname if present.\n *\n * This function get the locales from the configuration if not provided.\n *\n * Example:\n *\n * ```ts\n * getPathWithoutLocale('/en/dashboard') // Returns '/dashboard'\n * getPathWithoutLocale('/fr/dashboard') // Returns '/dashboard'\n * getPathWithoutLocale('/dashboard') // Returns '/dashboard'\n * getPathWithoutLocale('dashboard') // Returns 'dashboard'\n * getPathWithoutLocale('https://example.com/en/dashboard') // Returns 'https://example.com/dashboard'\n * getPathWithoutLocale('https://example.com/fr/dashboard') // Returns 'https://example.com/dashboard'\n * getPathWithoutLocale('https://example.com/dashboard') // Returns 'https://example.com/dashboard'\n * ```\n *\n * @param inputUrl - The complete URL string or pathname to process.\n * @param locales - Optional array of supported locales. Defaults to `localesDefault`.\n * @returns The URL string or pathname without the locale segment.\n */\nexport const getPathWithoutLocale = (\n inputUrl: string,\n locales: Locales[] = localesDefault\n): string => {\n // Determine if the input is an absolute URL\n const isAbsoluteUrl = checkIsAbsoluteUrl(inputUrl);\n\n // If it's an absolute URL, parse it using the URL constructor\n // Otherwise, handle it as a relative pathname\n const url = isAbsoluteUrl\n ? new URL(inputUrl)\n : new URL(inputUrl, 'http://example.com');\n\n const urlWithoutLocale = removeLocaleFromUrl(url.toString(), locales);\n\n if (isAbsoluteUrl) {\n // If the input was an absolute URL, return the modified URL as a string\n return urlWithoutLocale;\n }\n\n // If the input was a relative pathname, return the modified pathname\n return urlWithoutLocale.replace('http://example.com', '');\n};\n\nexport const checkIsAbsoluteUrl = (url: string): boolean =>\n /^[a-zA-Z][a-zA-Z\\d+\\-.]*:/.test(url);\n"],"mappings":"AAAA,SAAS,wBAAsC;AAE/C,MAAM,EAAE,qBAAqB,IAAI,iBAAiB;AAClD,MAAM,EAAE,SAAS,eAAe,IAAI;AAmB7B,MAAM,sBAAsB,CACjC,UACA,UAAqB,mBACV;AAEX,QAAM,MAAM,IAAI,IAAI,QAAQ;AAE5B,QAAM,WAAW,IAAI;AAGrB,MAAI,CAAC,SAAS,WAAW,GAAG,GAAG;AAE7B,QAAI,WAAW,IAAI,QAAQ;AAAA,EAC7B;AAGA,QAAM,eAAe,SAAS,MAAM,GAAG;AACvC,QAAM,eAAe,aAAa,CAAC;AAGnC,MAAI,QAAQ,SAAS,YAAuB,GAAG;AAE7C,iBAAa,OAAO,GAAG,CAAC;AAGxB,UAAM,cAAc,aAAa,KAAK,GAAG,KAAK;AAC9C,QAAI,WAAW;AAAA,EACjB;AAGA,SAAO,IAAI,SAAS;AACtB;AAuBO,MAAM,uBAAuB,CAClC,UACA,UAAqB,mBACV;AAEX,QAAM,gBAAgB,mBAAmB,QAAQ;AAIjD,QAAM,MAAM,gBACR,IAAI,IAAI,QAAQ,IAChB,IAAI,IAAI,UAAU,oBAAoB;AAE1C,QAAM,mBAAmB,oBAAoB,IAAI,SAAS,GAAG,OAAO;AAEpE,MAAI,eAAe;AAEjB,WAAO;AAAA,EACT;AAGA,SAAO,iBAAiB,QAAQ,sBAAsB,EAAE;AAC1D;AAEO,MAAM,qBAAqB,CAAC,QACjC,4BAA4B,KAAK,GAAG;","names":[]}
@@ -14,6 +14,7 @@ import { isSameKeyPath } from './utils/isSameKeyPath.mjs';
14
14
  import { localeDetector } from './localeDetector.mjs';
15
15
  import { getPathWithoutLocale } from './getPathWithoutLocale.mjs';
16
16
  import { getMultilingualUrls } from './getMultilingualUrls.mjs';
17
+ import { getLocalizedUrl } from './getLocalizedUrl.mjs';
17
18
  export {
18
19
  NodeType,
19
20
  enu,
@@ -22,6 +23,7 @@ export {
22
23
  getHTMLLang,
23
24
  getHTMLTextDir,
24
25
  getLocaleName,
26
+ getLocalizedUrl,
25
27
  getMultilingualUrls,
26
28
  getPathWithoutLocale,
27
29
  getTranslationContent,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export type {\n CustomizableLanguageContent,\n LanguageContent,\n TranslationContent,\n EnumerationContent,\n QuantityContent,\n CustomLocales as Locales,\n} from './transpiler/content_transformers/index';\nexport {\n t,\n enu,\n getTranslationContent,\n findMatchingCondition,\n getEnumerationContent,\n} from './transpiler/content_transformers/index';\nexport type {\n ContentValue,\n Content,\n FlatContentValue,\n FlatContent,\n TypedNode,\n DeclarationContent,\n KeyPath,\n ObjectNode,\n ArrayNode,\n RecursiveDictionaryValue,\n TranslationNode,\n EnumerationNode,\n DictionaryValue,\n Dictionary,\n} from './types/index';\nexport { NodeType } from './types/index';\nexport { getLocaleName } from './getLocaleName';\nexport { getHTMLTextDir } from './getHTMLTextDir';\nexport { getHTMLLang } from './getHTMLLang';\nexport { localeList } from './localeList';\nexport { isSameKeyPath } from './utils/isSameKeyPath';\nexport { localeDetector } from './localeDetector';\nexport { getPathWithoutLocale } from './getPathWithoutLocale';\nexport { getMultilingualUrls } from './getMultilingualUrls';\n"],"mappings":"AAQA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAiBP,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,4BAA4B;AACrC,SAAS,2BAA2B;","names":[]}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export type {\n CustomizableLanguageContent,\n LanguageContent,\n TranslationContent,\n EnumerationContent,\n QuantityContent,\n CustomLocales as Locales,\n} from './transpiler/content_transformers/index';\nexport {\n t,\n enu,\n getTranslationContent,\n findMatchingCondition,\n getEnumerationContent,\n} from './transpiler/content_transformers/index';\nexport type {\n ContentValue,\n Content,\n FlatContentValue,\n FlatContent,\n TypedNode,\n DeclarationContent,\n KeyPath,\n ObjectNode,\n ArrayNode,\n RecursiveDictionaryValue,\n TranslationNode,\n EnumerationNode,\n DictionaryValue,\n Dictionary,\n} from './types/index';\nexport { NodeType } from './types/index';\nexport { getLocaleName } from './getLocaleName';\nexport { getHTMLTextDir } from './getHTMLTextDir';\nexport { getHTMLLang } from './getHTMLLang';\nexport { localeList } from './localeList';\nexport { isSameKeyPath } from './utils/isSameKeyPath';\nexport { localeDetector } from './localeDetector';\nexport { getPathWithoutLocale } from './getPathWithoutLocale';\nexport { getMultilingualUrls } from './getMultilingualUrls';\nexport { getLocalizedUrl } from './getLocalizedUrl';\n"],"mappings":"AAQA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAiBP,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,4BAA4B;AACrC,SAAS,2BAA2B;AACpC,SAAS,uBAAuB;","names":[]}
@@ -0,0 +1,30 @@
1
+ import { Locales } from '@intlayer/config/client';
2
+ /**
3
+ * Generate URL by prefixing the given URL with the referenced locale.
4
+ * Handles both absolute and relative URLs appropriately.
5
+ *
6
+ * This function get the locales, default locale, and prefix default from the configuration if not provided.
7
+ *
8
+ * Example:
9
+ *
10
+ * ```ts
11
+ * getCurrentUrl('/about', currentLocale, ['en', 'fr'], 'en', false);
12
+ * // Returns '/fr/about' for the French locale
13
+ * // Returns '/about' for the default locale
14
+ * // Returns '/about' for the Italian locale
15
+ *
16
+ * getCurrentUrl('https://example.com/about', currentLocale, ['en', 'fr'], 'en', false);
17
+ * // Returns 'https://example.com/fr/about' for the French locale
18
+ * // Returns 'https://example.com/about' for the default locale
19
+ * // Returns 'https://example.com/about' for the Italian locale
20
+ * ```
21
+ *
22
+ * @param url - The original URL string to be prefixed with locales.
23
+ * @param currentLocale - The current locale.
24
+ * @param locales - Optional array of supported locales. Defaults to `localesDefault`.
25
+ * @param defaultLocale - The default locale. Defaults to `defaultLocaleDefault`.
26
+ * @param prefixDefault - Whether to prefix the default locale. Defaults to `prefixDefaultDefault`.
27
+ * @returns An object mapping each locale to its corresponding multilingual URL.
28
+ */
29
+ export declare const getLocalizedUrl: (url: string, currentLocale: Locales, locales?: Locales[], defaultLocale?: Locales, prefixDefault?: boolean) => string;
30
+ //# sourceMappingURL=getLocalizedUrl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getLocalizedUrl.d.ts","sourceRoot":"","sources":["../../src/getLocalizedUrl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,OAAO,EAAE,MAAM,yBAAyB,CAAC;AASpE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,eAAe,QACrB,MAAM,iBACI,OAAO,YACb,OAAO,EAAE,kBACH,OAAO,kBACP,OAAO,KACrB,MAYF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"getPathWithoutLocale.d.ts","sourceRoot":"","sources":["../../src/getPathWithoutLocale.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAKzE;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,mBAAmB,aACpB,MAAM,YACP,OAAO,EAAE,KACjB,MA6BF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,oBAAoB,aACrB,MAAM,YACP,OAAO,EAAE,KACjB,MAmBF,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAAS,MAAM,KAAG,OACV,CAAC"}
1
+ {"version":3,"file":"getPathWithoutLocale.d.ts","sourceRoot":"","sources":["../../src/getPathWithoutLocale.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAKzE;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,mBAAmB,aACpB,MAAM,YACP,OAAO,EAAE,KACjB,MA4BF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,oBAAoB,aACrB,MAAM,YACP,OAAO,EAAE,KACjB,MAmBF,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAAS,MAAM,KAAG,OACV,CAAC"}
@@ -10,4 +10,5 @@ export { isSameKeyPath } from './utils/isSameKeyPath';
10
10
  export { localeDetector } from './localeDetector';
11
11
  export { getPathWithoutLocale } from './getPathWithoutLocale';
12
12
  export { getMultilingualUrls } from './getMultilingualUrls';
13
+ export { getLocalizedUrl } from './getLocalizedUrl';
13
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,2BAA2B,EAC3B,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,aAAa,IAAI,OAAO,GACzB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,CAAC,EACD,GAAG,EACH,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,yCAAyC,CAAC;AACjD,YAAY,EACV,YAAY,EACZ,OAAO,EACP,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,OAAO,EACP,UAAU,EACV,SAAS,EACT,wBAAwB,EACxB,eAAe,EACf,eAAe,EACf,eAAe,EACf,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,2BAA2B,EAC3B,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,aAAa,IAAI,OAAO,GACzB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,CAAC,EACD,GAAG,EACH,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,yCAAyC,CAAC;AACjD,YAAY,EACV,YAAY,EACZ,OAAO,EACP,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,OAAO,EACP,UAAU,EACV,SAAS,EACT,wBAAwB,EACxB,eAAe,EACf,eAAe,EACf,eAAe,EACf,UAAU,GACX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/core",
3
- "version": "3.5.1",
3
+ "version": "3.5.2",
4
4
  "private": false,
5
5
  "description": "IntLayer - Layer of abstraction between the business logic and the data access layer. Manage internationalization in a simple way, through TypeScript, JavaScript or JSON declaration file.",
6
6
  "keywords": [
@@ -61,7 +61,7 @@
61
61
  "@formatjs/intl-localematcher": "^0.5.4",
62
62
  "chokidar": "^3.6.0",
63
63
  "negotiator": "^0.6.3",
64
- "@intlayer/config": "^3.5.1"
64
+ "@intlayer/config": "^3.5.2"
65
65
  },
66
66
  "devDependencies": {
67
67
  "@types/negotiator": "^0.6.3",
@@ -74,14 +74,14 @@
74
74
  "tsc-alias": "^1.8.10",
75
75
  "tsup": "^8.3.5",
76
76
  "typescript": "^5.7.2",
77
- "@utils/ts-config-types": "^1.0.4",
78
- "@utils/tsup-config": "^1.0.4",
77
+ "@utils/eslint-config": "^1.0.4",
79
78
  "@utils/ts-config": "^1.0.4",
80
- "@utils/eslint-config": "^1.0.4"
79
+ "@utils/ts-config-types": "^1.0.4",
80
+ "@utils/tsup-config": "^1.0.4"
81
81
  },
82
82
  "peerDependencies": {
83
83
  "react": ">=16.0.0 <19.0.0",
84
- "@intlayer/config": "^3.5.1"
84
+ "@intlayer/config": "^3.5.2"
85
85
  },
86
86
  "engines": {
87
87
  "node": ">=14.18"