@intlayer/core 3.5.3 → 3.5.5

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.
Files changed (109) hide show
  1. package/dist/cjs/{getHTMLLang.cjs → getLocaleLang.cjs} +7 -7
  2. package/dist/cjs/getLocaleLang.cjs.map +1 -0
  3. package/dist/cjs/getLocaleName.cjs +251 -233
  4. package/dist/cjs/getLocaleName.cjs.map +1 -1
  5. package/dist/cjs/getMultilingualUrls.cjs +4 -1
  6. package/dist/cjs/getMultilingualUrls.cjs.map +1 -1
  7. package/dist/cjs/index.cjs +3 -3
  8. package/dist/cjs/index.cjs.map +1 -1
  9. package/dist/cjs/localeNames/ar.cjs +262 -0
  10. package/dist/cjs/localeNames/ar.cjs.map +1 -0
  11. package/dist/cjs/localeNames/du.cjs +262 -0
  12. package/dist/cjs/localeNames/du.cjs.map +1 -0
  13. package/dist/cjs/localeNames/en.cjs +262 -0
  14. package/dist/cjs/localeNames/en.cjs.map +1 -0
  15. package/dist/cjs/localeNames/es.cjs +262 -0
  16. package/dist/cjs/localeNames/es.cjs.map +1 -0
  17. package/dist/cjs/localeNames/fr.cjs +262 -0
  18. package/dist/cjs/localeNames/fr.cjs.map +1 -0
  19. package/dist/cjs/localeNames/hi.cjs +262 -0
  20. package/dist/cjs/localeNames/hi.cjs.map +1 -0
  21. package/dist/cjs/localeNames/it.cjs +262 -0
  22. package/dist/cjs/localeNames/it.cjs.map +1 -0
  23. package/dist/cjs/localeNames/ja.cjs +262 -0
  24. package/dist/cjs/localeNames/ja.cjs.map +1 -0
  25. package/dist/cjs/localeNames/ko.cjs +262 -0
  26. package/dist/cjs/localeNames/ko.cjs.map +1 -0
  27. package/dist/cjs/localeNames/ownLocalesName.cjs +262 -0
  28. package/dist/cjs/localeNames/ownLocalesName.cjs.map +1 -0
  29. package/dist/cjs/localeNames/pt.cjs +262 -0
  30. package/dist/cjs/localeNames/pt.cjs.map +1 -0
  31. package/dist/cjs/localeNames/ru.cjs +262 -0
  32. package/dist/cjs/localeNames/ru.cjs.map +1 -0
  33. package/dist/cjs/localeNames/zh.cjs +262 -0
  34. package/dist/cjs/localeNames/zh.cjs.map +1 -0
  35. package/dist/cjs/types/declarationContent.cjs.map +1 -1
  36. package/dist/esm/getLocaleLang.mjs +5 -0
  37. package/dist/esm/getLocaleLang.mjs.map +1 -0
  38. package/dist/esm/getLocaleName.mjs +251 -233
  39. package/dist/esm/getLocaleName.mjs.map +1 -1
  40. package/dist/esm/getMultilingualUrls.mjs +4 -1
  41. package/dist/esm/getMultilingualUrls.mjs.map +1 -1
  42. package/dist/esm/index.mjs +2 -2
  43. package/dist/esm/index.mjs.map +1 -1
  44. package/dist/esm/localeNames/ar.mjs +238 -0
  45. package/dist/esm/localeNames/ar.mjs.map +1 -0
  46. package/dist/esm/localeNames/du.mjs +238 -0
  47. package/dist/esm/localeNames/du.mjs.map +1 -0
  48. package/dist/esm/localeNames/en.mjs +238 -0
  49. package/dist/esm/localeNames/en.mjs.map +1 -0
  50. package/dist/esm/localeNames/es.mjs +238 -0
  51. package/dist/esm/localeNames/es.mjs.map +1 -0
  52. package/dist/esm/localeNames/fr.mjs +238 -0
  53. package/dist/esm/localeNames/fr.mjs.map +1 -0
  54. package/dist/esm/localeNames/hi.mjs +238 -0
  55. package/dist/esm/localeNames/hi.mjs.map +1 -0
  56. package/dist/esm/localeNames/it.mjs +238 -0
  57. package/dist/esm/localeNames/it.mjs.map +1 -0
  58. package/dist/esm/localeNames/ja.mjs +238 -0
  59. package/dist/esm/localeNames/ja.mjs.map +1 -0
  60. package/dist/esm/localeNames/ko.mjs +238 -0
  61. package/dist/esm/localeNames/ko.mjs.map +1 -0
  62. package/dist/esm/localeNames/ownLocalesName.mjs +238 -0
  63. package/dist/esm/localeNames/ownLocalesName.mjs.map +1 -0
  64. package/dist/esm/localeNames/pt.mjs +238 -0
  65. package/dist/esm/localeNames/pt.mjs.map +1 -0
  66. package/dist/esm/localeNames/ru.mjs +238 -0
  67. package/dist/esm/localeNames/ru.mjs.map +1 -0
  68. package/dist/esm/localeNames/zh.mjs +238 -0
  69. package/dist/esm/localeNames/zh.mjs.map +1 -0
  70. package/dist/types/{getHTMLLang.d.ts → getLocaleLang.d.ts} +6 -6
  71. package/dist/types/getLocaleLang.d.ts.map +1 -0
  72. package/dist/types/getLocaleName.d.ts +8 -1
  73. package/dist/types/getLocaleName.d.ts.map +1 -1
  74. package/dist/types/getMultilingualUrls.d.ts.map +1 -1
  75. package/dist/types/index.d.ts +1 -1
  76. package/dist/types/index.d.ts.map +1 -1
  77. package/dist/types/localeNames/ar.d.ts +3 -0
  78. package/dist/types/localeNames/ar.d.ts.map +1 -0
  79. package/dist/types/localeNames/du.d.ts +3 -0
  80. package/dist/types/localeNames/du.d.ts.map +1 -0
  81. package/dist/types/localeNames/en.d.ts +3 -0
  82. package/dist/types/localeNames/en.d.ts.map +1 -0
  83. package/dist/types/localeNames/es.d.ts +3 -0
  84. package/dist/types/localeNames/es.d.ts.map +1 -0
  85. package/dist/types/localeNames/fr.d.ts +3 -0
  86. package/dist/types/localeNames/fr.d.ts.map +1 -0
  87. package/dist/types/localeNames/hi.d.ts +3 -0
  88. package/dist/types/localeNames/hi.d.ts.map +1 -0
  89. package/dist/types/localeNames/it.d.ts +3 -0
  90. package/dist/types/localeNames/it.d.ts.map +1 -0
  91. package/dist/types/localeNames/ja.d.ts +3 -0
  92. package/dist/types/localeNames/ja.d.ts.map +1 -0
  93. package/dist/types/localeNames/ko.d.ts +3 -0
  94. package/dist/types/localeNames/ko.d.ts.map +1 -0
  95. package/dist/types/localeNames/ownLocalesName.d.ts +3 -0
  96. package/dist/types/localeNames/ownLocalesName.d.ts.map +1 -0
  97. package/dist/types/localeNames/pt.d.ts +3 -0
  98. package/dist/types/localeNames/pt.d.ts.map +1 -0
  99. package/dist/types/localeNames/ru.d.ts +3 -0
  100. package/dist/types/localeNames/ru.d.ts.map +1 -0
  101. package/dist/types/localeNames/zh.d.ts +3 -0
  102. package/dist/types/localeNames/zh.d.ts.map +1 -0
  103. package/dist/types/types/declarationContent.d.ts +3 -3
  104. package/dist/types/types/declarationContent.d.ts.map +1 -1
  105. package/package.json +5 -5
  106. package/dist/cjs/getHTMLLang.cjs.map +0 -1
  107. package/dist/esm/getHTMLLang.mjs +0 -5
  108. package/dist/esm/getHTMLLang.mjs.map +0 -1
  109. package/dist/types/getHTMLLang.d.ts.map +0 -1
@@ -4,13 +4,13 @@ import type { Locales } from '@intlayer/config/client';
4
4
  *
5
5
  * Example:
6
6
  *
7
- * getHTMLLang('en-US') // 'en'
8
- * getHTMLLang('en') // 'en'
9
- * getHTMLLang('fr-CA') // 'fr'
10
- * getHTMLLang('fr') // 'fr'
7
+ * getLocaleLang('en-US') // 'en'
8
+ * getLocaleLang('en') // 'en'
9
+ * getLocaleLang('fr-CA') // 'fr'
10
+ * getLocaleLang('fr') // 'fr'
11
11
  *
12
12
  * @param locale The locale to get the language code for.
13
13
  * @returns The language code of the given locale.
14
14
  */
15
- export declare const getHTMLLang: (locale?: Locales) => string;
16
- //# sourceMappingURL=getHTMLLang.d.ts.map
15
+ export declare const getLocaleLang: (locale?: Locales) => string;
16
+ //# sourceMappingURL=getLocaleLang.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getLocaleLang.d.ts","sourceRoot":"","sources":["../../src/getLocaleLang.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEvD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,YAAa,OAAO,KAAG,MACpB,CAAC"}
@@ -1,3 +1,10 @@
1
1
  import { Locales } from '@intlayer/config/client';
2
- export declare const getLocaleName: (locale: Locales) => string;
2
+ /**
3
+ * Given a displayLocale (the locale in which you want the name displayed)
4
+ * and a targetLocale (the locale whose name you want),
5
+ * returns the localized name.
6
+ *
7
+ * If no targetLocale is provided, the displayLocale's own name is returned.
8
+ */
9
+ export declare const getLocaleName: (displayLocale: Locales, targetLocale?: Locales) => string;
3
10
  //# sourceMappingURL=getLocaleName.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getLocaleName.d.ts","sourceRoot":"","sources":["../../src/getLocaleName.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AA6OlD,eAAO,MAAM,aAAa,WAAY,OAAO,KAAG,MACtB,CAAC"}
1
+ {"version":3,"file":"getLocaleName.d.ts","sourceRoot":"","sources":["../../src/getLocaleName.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AA6PlD;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,kBACT,OAAO,iBACP,OAAO,KACrB,MAWF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"getMultilingualUrls.d.ts","sourceRoot":"","sources":["../../src/getMultilingualUrls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAY/C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,mBAAmB,QACzB,MAAM,YACF,OAAO,EAAE,kBACH,OAAO,kBACP,OAAO,KACrB,cAAc,CAAC,MAAM,CAmDvB,CAAC"}
1
+ {"version":3,"file":"getMultilingualUrls.d.ts","sourceRoot":"","sources":["../../src/getMultilingualUrls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAY/C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,mBAAmB,QACzB,MAAM,YACF,OAAO,EAAE,kBACH,OAAO,kBACP,OAAO,KACrB,cAAc,CAAC,MAAM,CAuDvB,CAAC"}
@@ -4,7 +4,7 @@ export type { ContentValue, Content, FlatContentValue, FlatContent, TypedNode, D
4
4
  export { NodeType } from './types/index';
5
5
  export { getLocaleName } from './getLocaleName';
6
6
  export { getHTMLTextDir } from './getHTMLTextDir';
7
- export { getHTMLLang } from './getHTMLLang';
7
+ export { getLocaleLang } from './getLocaleLang';
8
8
  export { localeList } from './localeList';
9
9
  export { isSameKeyPath } from './utils/isSameKeyPath';
10
10
  export { localeDetector } from './localeDetector';
@@ -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;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,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,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,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"}
@@ -0,0 +1,3 @@
1
+ import { Locales } from '@intlayer/config/client';
2
+ export declare const arabicLocales: Record<Locales, string>;
3
+ //# sourceMappingURL=ar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ar.d.ts","sourceRoot":"","sources":["../../../src/localeNames/ar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAwOjD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Locales } from '@intlayer/config/client';
2
+ export declare const germanLocales: Record<Locales, string>;
3
+ //# sourceMappingURL=du.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"du.d.ts","sourceRoot":"","sources":["../../../src/localeNames/du.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CA8OjD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Locales } from '@intlayer/config/client';
2
+ export declare const englishLocales: Record<Locales, string>;
3
+ //# sourceMappingURL=en.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../src/localeNames/en.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CA4OlD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Locales } from '@intlayer/config/client';
2
+ export declare const spanishLocales: Record<Locales, string>;
3
+ //# sourceMappingURL=es.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"es.d.ts","sourceRoot":"","sources":["../../../src/localeNames/es.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CA2OlD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Locales } from '@intlayer/config/client';
2
+ export declare const frenchLocales: Record<Locales, string>;
3
+ //# sourceMappingURL=fr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../../src/localeNames/fr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CA2OjD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Locales } from '@intlayer/config/client';
2
+ export declare const hindiLocales: Record<Locales, string>;
3
+ //# sourceMappingURL=hi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hi.d.ts","sourceRoot":"","sources":["../../../src/localeNames/hi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CA8OhD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Locales } from '@intlayer/config/client';
2
+ export declare const italianLocales: Record<Locales, string>;
3
+ //# sourceMappingURL=it.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"it.d.ts","sourceRoot":"","sources":["../../../src/localeNames/it.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CA2OlD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Locales } from '@intlayer/config/client';
2
+ export declare const japaneseLocales: Record<Locales, string>;
3
+ //# sourceMappingURL=ja.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ja.d.ts","sourceRoot":"","sources":["../../../src/localeNames/ja.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAgPnD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Locales } from '@intlayer/config/client';
2
+ export declare const koreanLocales: Record<Locales, string>;
3
+ //# sourceMappingURL=ko.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ko.d.ts","sourceRoot":"","sources":["../../../src/localeNames/ko.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CA8OjD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Locales } from '@intlayer/config/client';
2
+ export declare const ownLocalesName: Record<Locales, string>;
3
+ //# sourceMappingURL=ownLocalesName.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ownLocalesName.d.ts","sourceRoot":"","sources":["../../../src/localeNames/ownLocalesName.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAyOlD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Locales } from '@intlayer/config/client';
2
+ export declare const portugueseLocales: Record<Locales, string>;
3
+ //# sourceMappingURL=pt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pt.d.ts","sourceRoot":"","sources":["../../../src/localeNames/pt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CA2OrD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Locales } from '@intlayer/config/client';
2
+ export declare const russianLocales: Record<Locales, string>;
3
+ //# sourceMappingURL=ru.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ru.d.ts","sourceRoot":"","sources":["../../../src/localeNames/ru.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CA8OlD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Locales } from '@intlayer/config/client';
2
+ export declare const chineseLocales: Record<Locales, string>;
3
+ //# sourceMappingURL=zh.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zh.d.ts","sourceRoot":"","sources":["../../../src/localeNames/zh.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CA6OlD,CAAC"}
@@ -1,6 +1,5 @@
1
- import type { ReactNode } from 'react';
2
1
  import type { EnumerationContent, TranslationContent } from '../transpiler/index';
3
- export type TypedNode = TranslationContent<unknown> | EnumerationContent<unknown>;
2
+ export type TypedNode<T = unknown> = TranslationContent<T> | EnumerationContent<T>;
4
3
  export type ContentValue = string | string[] | number | number[] | {
5
4
  [key: string]: ContentValue;
6
5
  } | (() => ContentValue) | Promise<ContentValue> | TypedNode;
@@ -9,8 +8,9 @@ export type FlatContentValue = string | {
9
8
  [key: string]: FlatContentValue;
10
9
  } | TypedNode;
11
10
  export type FlatContent = Record<string, FlatContentValue | undefined>;
11
+ type IsArray<T> = T extends any[] ? true : false;
12
12
  type ReplaceContentValue<T> = {
13
- [P in keyof T]: T[P] extends string | number | boolean | null | ReactNode ? ContentValue : T[P] extends object ? ReplaceContentValue<T[P]> : ReplaceContentValueArray<T[P]>;
13
+ [P in keyof T]: IsArray<T[P]> extends true ? ReplaceContentValueArray<T[P]> : T[P] extends object ? ReplaceContentValue<T[P]> : T[P] | TypedNode<T[P]>;
14
14
  };
15
15
  type ReplaceContentValueArray<T> = T extends (infer U)[] ? ReplaceContentValue<U>[] : ReplaceContentValue<T>;
16
16
  export type DeclarationContent<T = undefined> = {
@@ -1 +1 @@
1
- {"version":3,"file":"declarationContent.d.ts","sourceRoot":"","sources":["../../../src/types/declarationContent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AK,CAAC;AAGjD,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAC3B,CAAC,IAAI,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GACtC,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAC9B,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GACjB,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACzB,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC7B,CAAC;AAEF,KAAK,wBAAwB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GACpD,mBAAmB,CAAC,CAAC,CAAC,EAAE,GACxB,mBAAmB,CAAC,CAAC,CAAC,CAAC;AAE3B,MAAM,MAAM,kBAAkB,CAAC,CAAC,GAAG,SAAS,IAAI;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,CAAC,SAAS,SAAS,GACxB,OAAO,GACP,mBAAmB,CAAC,CAAC,CAAC,CAAC;CAC5B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/core",
3
- "version": "3.5.3",
3
+ "version": "3.5.5",
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.3"
64
+ "@intlayer/config": "^3.5.5"
65
65
  },
66
66
  "devDependencies": {
67
67
  "@types/negotiator": "^0.6.3",
@@ -75,13 +75,13 @@
75
75
  "tsup": "^8.3.5",
76
76
  "typescript": "^5.7.2",
77
77
  "@utils/eslint-config": "^1.0.4",
78
+ "@utils/tsup-config": "^1.0.4",
78
79
  "@utils/ts-config": "^1.0.4",
79
- "@utils/ts-config-types": "^1.0.4",
80
- "@utils/tsup-config": "^1.0.4"
80
+ "@utils/ts-config-types": "^1.0.4"
81
81
  },
82
82
  "peerDependencies": {
83
83
  "react": ">=16.0.0 <19.0.0",
84
- "@intlayer/config": "^3.5.3"
84
+ "@intlayer/config": "^3.5.5"
85
85
  },
86
86
  "engines": {
87
87
  "node": ">=14.18"
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/getHTMLLang.ts"],"sourcesContent":["import type { Locales } from '@intlayer/config/client';\n\n/**\n * Returns the language code of the given locale for locales including the country code.\n *\n * Example:\n *\n * getHTMLLang('en-US') // 'en'\n * getHTMLLang('en') // 'en'\n * getHTMLLang('fr-CA') // 'fr'\n * getHTMLLang('fr') // 'fr'\n *\n * @param locale The locale to get the language code for.\n * @returns The language code of the given locale.\n */\nexport const getHTMLLang = (locale?: Locales): string =>\n locale?.split('-')[0] ?? '';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,MAAM,cAAc,CAAC,WAC1B,QAAQ,MAAM,GAAG,EAAE,CAAC,KAAK;","names":[]}
@@ -1,5 +0,0 @@
1
- const getHTMLLang = (locale) => locale?.split("-")[0] ?? "";
2
- export {
3
- getHTMLLang
4
- };
5
- //# sourceMappingURL=getHTMLLang.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/getHTMLLang.ts"],"sourcesContent":["import type { Locales } from '@intlayer/config/client';\n\n/**\n * Returns the language code of the given locale for locales including the country code.\n *\n * Example:\n *\n * getHTMLLang('en-US') // 'en'\n * getHTMLLang('en') // 'en'\n * getHTMLLang('fr-CA') // 'fr'\n * getHTMLLang('fr') // 'fr'\n *\n * @param locale The locale to get the language code for.\n * @returns The language code of the given locale.\n */\nexport const getHTMLLang = (locale?: Locales): string =>\n locale?.split('-')[0] ?? '';\n"],"mappings":"AAeO,MAAM,cAAc,CAAC,WAC1B,QAAQ,MAAM,GAAG,EAAE,CAAC,KAAK;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getHTMLLang.d.ts","sourceRoot":"","sources":["../../src/getHTMLLang.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEvD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW,YAAa,OAAO,KAAG,MAClB,CAAC"}