@prosopo/locale 2.3.2 → 2.4.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.
Files changed (60) hide show
  1. package/dist/i18nBackend.d.ts +3 -0
  2. package/dist/i18nBackend.d.ts.map +1 -0
  3. package/dist/i18nBackend.js +30 -0
  4. package/dist/i18nBackend.js.map +1 -0
  5. package/dist/i18nFrontend.d.ts +3 -0
  6. package/dist/i18nFrontend.d.ts.map +1 -0
  7. package/dist/i18nFrontend.js +49 -0
  8. package/dist/i18nFrontend.js.map +1 -0
  9. package/dist/i18nMiddleware.d.ts +4 -0
  10. package/dist/i18nMiddleware.d.ts.map +1 -0
  11. package/dist/i18nMiddleware.js +8 -0
  12. package/dist/i18nMiddleware.js.map +1 -0
  13. package/dist/index.d.ts +8 -4
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +6 -4
  16. package/dist/index.js.map +1 -1
  17. package/dist/loadI18next.d.ts +5 -0
  18. package/dist/loadI18next.d.ts.map +1 -0
  19. package/dist/loadI18next.js +21 -0
  20. package/dist/loadI18next.js.map +1 -0
  21. package/dist/locales/{de.json → de/translation.json} +2 -13
  22. package/dist/locales/{en.json → en/translation.json} +2 -13
  23. package/dist/locales/{es.json → es/translation.json} +2 -13
  24. package/dist/locales/{fr.json → fr/translation.json} +2 -13
  25. package/dist/locales/{it.json → it/translation.json} +2 -13
  26. package/dist/locales/{pt.json → pt/translation.json} +2 -13
  27. package/dist/locales/{pt-BR.json → pt-BR/translation.json} +2 -13
  28. package/dist/tests/locales.unit.test.js +1 -1
  29. package/dist/tests/locales.unit.test.js.map +1 -1
  30. package/dist/translationKey.d.ts +4 -0
  31. package/dist/translationKey.d.ts.map +1 -0
  32. package/dist/translationKey.js +21 -0
  33. package/dist/translationKey.js.map +1 -0
  34. package/dist/translations.d.ts +0 -2928
  35. package/dist/translations.d.ts.map +1 -1
  36. package/dist/translations.js +0 -16
  37. package/dist/translations.js.map +1 -1
  38. package/dist/useTranslation.d.ts +7 -0
  39. package/dist/useTranslation.d.ts.map +1 -0
  40. package/dist/useTranslation.js +8 -0
  41. package/dist/useTranslation.js.map +1 -0
  42. package/dist/util.d.ts +2 -4
  43. package/dist/util.d.ts.map +1 -1
  44. package/dist/util.js +5 -20
  45. package/dist/util.js.map +1 -1
  46. package/package.json +10 -6
  47. package/vite.cjs.config.ts +1 -1
  48. package/vite.test.config.ts +1 -1
  49. package/dist/node/i18nBackend.d.ts +0 -3
  50. package/dist/node/i18nBackend.d.ts.map +0 -1
  51. package/dist/node/i18nBackend.js +0 -16
  52. package/dist/node/i18nBackend.js.map +0 -1
  53. package/dist/node/i18nMiddleware.d.ts +0 -4
  54. package/dist/node/i18nMiddleware.d.ts.map +0 -1
  55. package/dist/node/i18nMiddleware.js +0 -7
  56. package/dist/node/i18nMiddleware.js.map +0 -1
  57. package/dist/node/index.d.ts +0 -2
  58. package/dist/node/index.d.ts.map +0 -1
  59. package/dist/node/index.js +0 -2
  60. package/dist/node/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../src/translations.ts"],"names":[],"mappings":"AAaA,OAAO,CAAC,MAAM,KAAK,CAAC;AASpB,eAAO,MAAM,SAAS,wDAAyD,CAAC;AAEhF,eAAO,MAAM,cAAc,0DAAoB,CAAC;AAEhD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQxB,CAAC"}
1
+ {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../src/translations.ts"],"names":[],"mappings":"AAcA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,eAAO,MAAM,SAAS,wDAAyD,CAAC;AAEhF,eAAO,MAAM,cAAc,0DAAoB,CAAC"}
@@ -1,20 +1,4 @@
1
1
  import z from "zod";
2
- import translationsDe from "./locales/de.json" with { type: "json" };
3
- import translationsEn from "./locales/en.json" with { type: "json" };
4
- import translationsEs from "./locales/es.json" with { type: "json" };
5
- import translationsFr from "./locales/fr.json" with { type: "json" };
6
- import translationsIt from "./locales/it.json" with { type: "json" };
7
- import translationsPtBR from "./locales/pt-BR.json" with { type: "json" };
8
- import translationsPt from "./locales/pt.json" with { type: "json" };
9
2
  export const Languages = ["de", "en", "es", "fr", "it", "pt", "pt-BR"];
10
3
  export const LanguageSchema = z.enum(Languages);
11
- export const translations = {
12
- [LanguageSchema.enum.de]: { translation: translationsDe },
13
- [LanguageSchema.enum.en]: { translation: translationsEn },
14
- [LanguageSchema.enum.es]: { translation: translationsEs },
15
- [LanguageSchema.enum.fr]: { translation: translationsFr },
16
- [LanguageSchema.enum.it]: { translation: translationsIt },
17
- [LanguageSchema.enum.pt]: { translation: translationsPt },
18
- [LanguageSchema.enum["pt-BR"]]: { translation: translationsPtBR },
19
- };
20
4
  //# sourceMappingURL=translations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"translations.js","sourceRoot":"","sources":["../src/translations.ts"],"names":[],"mappings":"AAaA,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,cAAc,MAAM,mBAAmB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACrE,OAAO,cAAc,MAAM,mBAAmB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACrE,OAAO,cAAc,MAAM,mBAAmB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACrE,OAAO,cAAc,MAAM,mBAAmB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACrE,OAAO,cAAc,MAAM,mBAAmB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACrE,OAAO,gBAAgB,MAAM,sBAAsB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1E,OAAO,cAAc,MAAM,mBAAmB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAErE,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAU,CAAC;AAEhF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAEhD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC3B,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE;IACzD,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE;IACzD,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE;IACzD,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE;IACzD,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE;IACzD,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE;IACzD,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,WAAW,EAAE,gBAAgB,EAAE;CACjE,CAAC"}
1
+ {"version":3,"file":"translations.js","sourceRoot":"","sources":["../src/translations.ts"],"names":[],"mappings":"AAcA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAU,CAAC;AAEhF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type UseTranslationOptions, type UseTranslationResponse } from "react-i18next";
2
+ import initializeI18n from "./i18nFrontend.js";
3
+ declare function useTranslation(options?: UseTranslationOptions<"translation">): UseTranslationResponse<"translation", any> & {
4
+ t: ReturnType<typeof initializeI18n>["t"];
5
+ };
6
+ export default useTranslation;
7
+ //# sourceMappingURL=useTranslation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTranslation.d.ts","sourceRoot":"","sources":["../src/useTranslation.ts"],"names":[],"mappings":"AAcA,OAAO,EACN,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAE3B,MAAM,eAAe,CAAC;AACvB,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/C,iBAAS,cAAc,CACtB,OAAO,CAAC,EAAE,qBAAqB,CAAC,aAAa,CAAC,GAE5C,sBAAsB,CAAC,aAAa,EAAE,GAAG,CAAC,GAAG;IAC/C,CAAC,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC;CAC1C,CAGA;AAED,eAAe,cAAc,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { useTranslation as useTranslationDefault, } from "react-i18next";
2
+ import initializeI18n from "./i18nFrontend.js";
3
+ function useTranslation(options) {
4
+ const i18n = initializeI18n();
5
+ return useTranslationDefault("translation", { i18n, ...options });
6
+ }
7
+ export default useTranslation;
8
+ //# sourceMappingURL=useTranslation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTranslation.js","sourceRoot":"","sources":["../src/useTranslation.ts"],"names":[],"mappings":"AAcA,OAAO,EAGN,cAAc,IAAI,qBAAqB,GACvC,MAAM,eAAe,CAAC;AACvB,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/C,SAAS,cAAc,CACtB,OAA8C;IAK9C,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;IAC9B,OAAO,qBAAqB,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;AACnE,CAAC;AAED,eAAe,cAAc,CAAC"}
package/dist/util.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- import { z } from "zod";
2
- export declare function isClientSide(): boolean;
3
- export declare const TranslationKeysSchema: z.ZodEnum<[string, ...string[]]>;
4
- export type TranslationKey = z.infer<typeof TranslationKeysSchema>;
1
+ export declare const isClientSide: () => boolean;
2
+ export declare const isServerSide: () => boolean;
5
3
  //# sourceMappingURL=util.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,wBAAgB,YAAY,IAAI,OAAO,CAMtC;AA4BD,eAAO,MAAM,qBAAqB,kCAEjC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,YAAY,QAAO,OAM/B,CAAC;AAEF,eAAO,MAAM,YAAY,QAAO,OAE/B,CAAC"}
package/dist/util.js CHANGED
@@ -1,24 +1,9 @@
1
- import { z } from "zod";
2
- import translationEn from "./locales/en.json" with { type: "json" };
3
- export function isClientSide() {
1
+ export const isClientSide = () => {
4
2
  return !!(typeof window !== "undefined" &&
5
3
  window.document &&
6
4
  window.document.createElement);
7
- }
8
- function getLeafFieldPath(obj) {
9
- if (typeof obj === "string") {
10
- return [];
11
- }
12
- return Object.keys(obj).reduce((arr, key) => {
13
- const value = obj[key];
14
- if (value === undefined) {
15
- throw new Error(`Undefined value for key ${key}`);
16
- }
17
- const children = getLeafFieldPath(value);
18
- return arr.concat(children.map((child) => {
19
- return `${key}.${child}`;
20
- }));
21
- }, []);
22
- }
23
- export const TranslationKeysSchema = z.enum(getLeafFieldPath(translationEn));
5
+ };
6
+ export const isServerSide = () => {
7
+ return !isClientSide();
8
+ };
24
9
  //# sourceMappingURL=util.js.map
package/dist/util.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,aAAa,MAAM,mBAAmB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAEpE,MAAM,UAAU,YAAY;IAC3B,OAAO,CAAC,CAAC,CACR,OAA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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prosopo/locale",
3
- "version": "2.3.2",
3
+ "version": "2.4.2",
4
4
  "description": "Prosopo locale library",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",
@@ -24,14 +24,18 @@
24
24
  "author": "Prosopo Limited",
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
27
- "express": "4.21.1",
28
- "i18next": "21.9.2",
29
- "i18next-http-backend": "1.4.5",
30
- "i18next-http-middleware": "3.6.0",
27
+ "i18next": "24.2.2",
28
+ "i18next-browser-languagedetector": "8.0.2",
29
+ "i18next-chained-backend": "4.6.2",
30
+ "i18next-fs-backend": "2.6.0",
31
+ "i18next-http-backend": "3.0.2",
32
+ "i18next-http-middleware": "3.7.1",
33
+ "i18next-resources-to-backend": "1.2.1",
34
+ "react-i18next": "15.4.0",
31
35
  "zod": "3.23.8"
32
36
  },
33
37
  "devDependencies": {
34
- "@prosopo/config": "2.3.2",
38
+ "@prosopo/config": "2.4.2",
35
39
  "@vitest/coverage-v8": "2.1.1",
36
40
  "del-cli": "6.0.0",
37
41
  "dotenv": "16.4.5",
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Prosopo (UK) Ltd.
1
+ // Copyright 2021-2025 Prosopo (UK) Ltd.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2024 Prosopo (UK) Ltd.
1
+ // Copyright 2021-2025 Prosopo (UK) Ltd.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.
@@ -1,3 +0,0 @@
1
- import i18n from "i18next";
2
- export default i18n;
3
- //# sourceMappingURL=i18nBackend.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"i18nBackend.d.ts","sourceRoot":"","sources":["../../src/node/i18nBackend.ts"],"names":[],"mappings":"AAcA,OAAO,IAA0B,MAAM,SAAS,CAAC;AAkBjD,eAAe,IAAI,CAAC"}
@@ -1,16 +0,0 @@
1
- import i18n from "i18next";
2
- import Backend from "i18next-http-backend";
3
- import { LanguageDetector as MiddlewareLanguageDetector } from "i18next-http-middleware";
4
- import { translations as resources } from "../translations.js";
5
- const commonOptions = {
6
- debug: false,
7
- fallbackLng: "en",
8
- resources,
9
- };
10
- const nodeOptions = {};
11
- i18n
12
- .use(new Backend(undefined, { reloadInterval: false }))
13
- .use(MiddlewareLanguageDetector)
14
- .init({ ...commonOptions, ...nodeOptions });
15
- export default i18n;
16
- //# sourceMappingURL=i18nBackend.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"i18nBackend.js","sourceRoot":"","sources":["../../src/node/i18nBackend.ts"],"names":[],"mappings":"AAcA,OAAO,IAA0B,MAAM,SAAS,CAAC;AACjD,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,IAAI,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACzF,OAAO,EAAE,YAAY,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,aAAa,GAAgB;IAClC,KAAK,EAAE,KAAK;IACZ,WAAW,EAAE,IAAI;IACjB,SAAS;CACT,CAAC;AAEF,MAAM,WAAW,GAAgB,EAAE,CAAC;AAEpC,IAAI;KACF,GAAG,CAAC,IAAI,OAAO,CAAC,SAAS,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAAC;KACtD,GAAG,CAAC,0BAA0B,CAAC;KAC/B,IAAI,CAAC,EAAE,GAAG,aAAa,EAAE,GAAG,WAAW,EAAE,CAAC,CAAC;AAE7C,eAAe,IAAI,CAAC"}
@@ -1,4 +0,0 @@
1
- import { type HandleOptions, handle } from "i18next-http-middleware";
2
- declare function i18nMiddleware(options: HandleOptions): ReturnType<typeof handle>;
3
- export default i18nMiddleware;
4
- //# sourceMappingURL=i18nMiddleware.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"i18nMiddleware.d.ts","sourceRoot":"","sources":["../../src/node/i18nMiddleware.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAIrE,iBAAS,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAGzE;AAED,eAAe,cAAc,CAAC"}
@@ -1,7 +0,0 @@
1
- import { handle } from "i18next-http-middleware";
2
- import i18n from "./i18nBackend.js";
3
- function i18nMiddleware(options) {
4
- return handle(i18n, { ...options });
5
- }
6
- export default i18nMiddleware;
7
- //# sourceMappingURL=i18nMiddleware.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"i18nMiddleware.js","sourceRoot":"","sources":["../../src/node/i18nMiddleware.ts"],"names":[],"mappings":"AAaA,OAAO,EAAsB,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,IAAI,MAAM,kBAAkB,CAAC;AAEpC,SAAS,cAAc,CAAC,OAAsB;IAE7C,OAAO,MAAM,CAAC,IAAI,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;AACrC,CAAC;AAED,eAAe,cAAc,CAAC"}
@@ -1,2 +0,0 @@
1
- export { default as i18nMiddleware } from "./i18nMiddleware.js";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1,2 +0,0 @@
1
- export { default as i18nMiddleware } from "./i18nMiddleware.js";
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC"}