@intlayer/core 1.0.0

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 (107) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/getLocaleName.cjs +494 -0
  3. package/dist/cjs/getLocaleName.cjs.map +1 -0
  4. package/dist/cjs/getLocaleName.d.ts +5 -0
  5. package/dist/cjs/index.cjs +51 -0
  6. package/dist/cjs/index.cjs.map +1 -0
  7. package/dist/cjs/index.d.ts +25 -0
  8. package/dist/cjs/localeList.cjs +261 -0
  9. package/dist/cjs/localeList.cjs.map +1 -0
  10. package/dist/cjs/localeList.d.ts +5 -0
  11. package/dist/cjs/transpiler/content_transformers/enumeration/enumeration.cjs +52 -0
  12. package/dist/cjs/transpiler/content_transformers/enumeration/enumeration.cjs.map +1 -0
  13. package/dist/cjs/transpiler/content_transformers/enumeration/enumeration.d.ts +32 -0
  14. package/dist/cjs/transpiler/content_transformers/enumeration/getEnumerationContent.cjs +62 -0
  15. package/dist/cjs/transpiler/content_transformers/enumeration/getEnumerationContent.cjs.map +1 -0
  16. package/dist/cjs/transpiler/content_transformers/enumeration/getEnumerationContent.d.ts +10 -0
  17. package/dist/cjs/transpiler/content_transformers/enumeration/index.cjs +37 -0
  18. package/dist/cjs/transpiler/content_transformers/enumeration/index.cjs.map +1 -0
  19. package/dist/cjs/transpiler/content_transformers/enumeration/index.d.ts +4 -0
  20. package/dist/cjs/transpiler/content_transformers/index.cjs +41 -0
  21. package/dist/cjs/transpiler/content_transformers/index.cjs.map +1 -0
  22. package/dist/cjs/transpiler/content_transformers/index.d.ts +15 -0
  23. package/dist/cjs/transpiler/content_transformers/translation/getTranslationContent.cjs +37 -0
  24. package/dist/cjs/transpiler/content_transformers/translation/getTranslationContent.cjs.map +1 -0
  25. package/dist/cjs/transpiler/content_transformers/translation/getTranslationContent.d.ts +11 -0
  26. package/dist/cjs/transpiler/content_transformers/translation/index.cjs +37 -0
  27. package/dist/cjs/transpiler/content_transformers/translation/index.cjs.map +1 -0
  28. package/dist/cjs/transpiler/content_transformers/translation/index.d.ts +5 -0
  29. package/dist/cjs/transpiler/content_transformers/translation/translations.cjs +54 -0
  30. package/dist/cjs/transpiler/content_transformers/translation/translations.cjs.map +1 -0
  31. package/dist/cjs/transpiler/content_transformers/translation/translations.d.ts +17 -0
  32. package/dist/cjs/transpiler/index.cjs +36 -0
  33. package/dist/cjs/transpiler/index.cjs.map +1 -0
  34. package/dist/cjs/transpiler/index.d.ts +13 -0
  35. package/dist/cjs/types/contentModule.cjs +21 -0
  36. package/dist/cjs/types/contentModule.cjs.map +1 -0
  37. package/dist/cjs/types/contentModule.d.ts +35 -0
  38. package/dist/cjs/types/index.cjs +34 -0
  39. package/dist/cjs/types/index.cjs.map +1 -0
  40. package/dist/cjs/types/index.d.ts +13 -0
  41. package/dist/cjs/types/nodeType.cjs +38 -0
  42. package/dist/cjs/types/nodeType.cjs.map +1 -0
  43. package/dist/cjs/types/nodeType.d.ts +6 -0
  44. package/dist/cjs/utils/getStackTraceInfo.cjs +50 -0
  45. package/dist/cjs/utils/getStackTraceInfo.cjs.map +1 -0
  46. package/dist/cjs/utils/getStackTraceInfo.d.ts +12 -0
  47. package/dist/esm/getLocaleName.d.mts +5 -0
  48. package/dist/esm/getLocaleName.mjs +463 -0
  49. package/dist/esm/getLocaleName.mjs.map +1 -0
  50. package/dist/esm/index.d.mts +25 -0
  51. package/dist/esm/index.mjs +19 -0
  52. package/dist/esm/index.mjs.map +1 -0
  53. package/dist/esm/localeList.d.mts +5 -0
  54. package/dist/esm/localeList.mjs +230 -0
  55. package/dist/esm/localeList.mjs.map +1 -0
  56. package/dist/esm/transpiler/content_transformers/enumeration/enumeration.d.mts +32 -0
  57. package/dist/esm/transpiler/content_transformers/enumeration/enumeration.mjs +21 -0
  58. package/dist/esm/transpiler/content_transformers/enumeration/enumeration.mjs.map +1 -0
  59. package/dist/esm/transpiler/content_transformers/enumeration/getEnumerationContent.d.mts +10 -0
  60. package/dist/esm/transpiler/content_transformers/enumeration/getEnumerationContent.mjs +31 -0
  61. package/dist/esm/transpiler/content_transformers/enumeration/getEnumerationContent.mjs.map +1 -0
  62. package/dist/esm/transpiler/content_transformers/enumeration/index.d.mts +4 -0
  63. package/dist/esm/transpiler/content_transformers/enumeration/index.mjs +3 -0
  64. package/dist/esm/transpiler/content_transformers/enumeration/index.mjs.map +1 -0
  65. package/dist/esm/transpiler/content_transformers/index.d.mts +15 -0
  66. package/dist/esm/transpiler/content_transformers/index.mjs +3 -0
  67. package/dist/esm/transpiler/content_transformers/index.mjs.map +1 -0
  68. package/dist/esm/transpiler/content_transformers/translation/getTranslationContent.d.mts +11 -0
  69. package/dist/esm/transpiler/content_transformers/translation/getTranslationContent.mjs +6 -0
  70. package/dist/esm/transpiler/content_transformers/translation/getTranslationContent.mjs.map +1 -0
  71. package/dist/esm/transpiler/content_transformers/translation/index.d.mts +5 -0
  72. package/dist/esm/transpiler/content_transformers/translation/index.mjs +3 -0
  73. package/dist/esm/transpiler/content_transformers/translation/index.mjs.map +1 -0
  74. package/dist/esm/transpiler/content_transformers/translation/translations.d.mts +17 -0
  75. package/dist/esm/transpiler/content_transformers/translation/translations.mjs +22 -0
  76. package/dist/esm/transpiler/content_transformers/translation/translations.mjs.map +1 -0
  77. package/dist/esm/transpiler/index.d.mts +13 -0
  78. package/dist/esm/transpiler/index.mjs +3 -0
  79. package/dist/esm/transpiler/index.mjs.map +1 -0
  80. package/dist/esm/types/contentModule.d.mts +35 -0
  81. package/dist/esm/types/contentModule.mjs +1 -0
  82. package/dist/esm/types/contentModule.mjs.map +1 -0
  83. package/dist/esm/types/index.d.mts +13 -0
  84. package/dist/esm/types/index.mjs +3 -0
  85. package/dist/esm/types/index.mjs.map +1 -0
  86. package/dist/esm/types/nodeType.d.mts +6 -0
  87. package/dist/esm/types/nodeType.mjs +7 -0
  88. package/dist/esm/types/nodeType.mjs.map +1 -0
  89. package/dist/esm/utils/getStackTraceInfo.d.mts +12 -0
  90. package/dist/esm/utils/getStackTraceInfo.mjs +19 -0
  91. package/dist/esm/utils/getStackTraceInfo.mjs.map +1 -0
  92. package/package.json +86 -0
  93. package/src/getLocaleName.ts +463 -0
  94. package/src/index.ts +23 -0
  95. package/src/localeList.ts +229 -0
  96. package/src/transpiler/content_transformers/enumeration/enumeration.ts +59 -0
  97. package/src/transpiler/content_transformers/enumeration/getEnumerationContent.ts +40 -0
  98. package/src/transpiler/content_transformers/enumeration/index.ts +2 -0
  99. package/src/transpiler/content_transformers/index.ts +2 -0
  100. package/src/transpiler/content_transformers/translation/getTranslationContent.ts +13 -0
  101. package/src/transpiler/content_transformers/translation/index.ts +2 -0
  102. package/src/transpiler/content_transformers/translation/translations.ts +42 -0
  103. package/src/transpiler/index.ts +7 -0
  104. package/src/types/contentModule.ts +32 -0
  105. package/src/types/index.ts +9 -0
  106. package/src/types/nodeType.ts +4 -0
  107. package/src/utils/getStackTraceInfo.ts +39 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/transpiler/content_transformers/translation/index.ts"],"sourcesContent":["export * from './translations';\nexport * from './getTranslationContent';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,gCAAc,2BAAd;AACA,gCAAc,oCADd;","names":[]}
@@ -0,0 +1,5 @@
1
+ export { LanguageContent, TranslationContent, t } from "./translations.js";
2
+ export { getTranslationContent } from "./getTranslationContent.js";
3
+ import "@intlayer/config/client";
4
+ import "../../../utils/getStackTraceInfo.js";
5
+ import "../../../types/nodeType.js";
@@ -0,0 +1,54 @@
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, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
17
+ });
18
+ }
19
+ return to;
20
+ };
21
+ var __toCommonJS = (mod) =>
22
+ __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
+ var translations_exports = {};
24
+ __export(translations_exports, {
25
+ t: () => translations,
26
+ });
27
+ module.exports = __toCommonJS(translations_exports);
28
+ var import_client = require("@intlayer/config/client");
29
+ var import_types = require("../../../types/index.cjs");
30
+ var import_getStackTraceInfo = require("../../../utils/getStackTraceInfo.cjs");
31
+ const translations = (content) => {
32
+ const stackTraceInfo = (0, import_getStackTraceInfo.getStackTraceInfo)();
33
+ if (typeof content === "string") {
34
+ const result2 = {
35
+ nodeType: import_types.NodeType.Translation,
36
+ ...stackTraceInfo,
37
+ [import_client.intlayerConfiguration.internationalization.defaultLocale]:
38
+ content,
39
+ };
40
+ return result2;
41
+ }
42
+ const result = {
43
+ nodeType: import_types.NodeType.Translation,
44
+ ...stackTraceInfo,
45
+ ...content,
46
+ };
47
+ return result;
48
+ };
49
+ // Annotate the CommonJS export names for ESM import in node:
50
+ 0 &&
51
+ (module.exports = {
52
+ t,
53
+ });
54
+ //# sourceMappingURL=translations.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/transpiler/content_transformers/translation/translations.ts"],"sourcesContent":["import { type Locales, intlayerConfiguration } from '@intlayer/config/client';\nimport type { ReactNode } from 'react';\nimport { NodeType } from '../../../types/index';\nimport {\n getStackTraceInfo,\n type NoteStackTraceInfo,\n} from '../../../utils/getStackTraceInfo';\n\nexport type LanguageContent<Content> = Record<Locales, Content>;\n\nexport type TranslationContent<Content> = Partial<LanguageContent<Content>> &\n NoteStackTraceInfo & {\n nodeType: NodeType.Translation;\n };\n\n/**\n * Create a JSON with the content and the stack trace information\n */\nconst translations = <Content>(\n content?: Partial<LanguageContent<Content>> | string\n) => {\n const stackTraceInfo = getStackTraceInfo();\n\n if (typeof content === 'string') {\n const result: TranslationContent<Content> = {\n nodeType: NodeType.Translation,\n ...stackTraceInfo,\n [intlayerConfiguration.internationalization.defaultLocale]: content,\n };\n\n return result;\n }\n\n const result: TranslationContent<Content> = {\n nodeType: NodeType.Translation,\n ...stackTraceInfo,\n ...content,\n };\n\n return result;\n};\n\nexport { translations as t };\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAoD;AAEpD,mBAAyB;AACzB,+BAGO;AAYP,MAAM,eAAe,CACnB,YACG;AACH,QAAM,qBAAiB,4CAAkB;AAEzC,MAAI,OAAO,YAAY,UAAU;AAC/B,UAAMA,UAAsC;AAAA,MAC1C,UAAU,sBAAS;AAAA,MACnB,GAAG;AAAA,MACH,CAAC,oCAAsB,qBAAqB,aAAa,GAAG;AAAA,IAC9D;AAEA,WAAOA;AAAA,EACT;AAEA,QAAM,SAAsC;AAAA,IAC1C,UAAU,sBAAS;AAAA,IACnB,GAAG;AAAA,IACH,GAAG;AAAA,EACL;AAEA,SAAO;AACT;","names":["result"]}
@@ -0,0 +1,17 @@
1
+ import { Locales } from "@intlayer/config/client";
2
+ import { NoteStackTraceInfo } from "../../../utils/getStackTraceInfo.js";
3
+ import { NodeType } from "../../../types/nodeType.js";
4
+
5
+ type LanguageContent<Content> = Record<Locales, Content>;
6
+ type TranslationContent<Content> = Partial<LanguageContent<Content>> &
7
+ NoteStackTraceInfo & {
8
+ nodeType: NodeType.Translation;
9
+ };
10
+ /**
11
+ * Create a JSON with the content and the stack trace information
12
+ */
13
+ declare const translations: <Content>(
14
+ content?: Partial<LanguageContent<Content>> | string
15
+ ) => TranslationContent<Content>;
16
+
17
+ export { type LanguageContent, type TranslationContent, translations as t };
@@ -0,0 +1,36 @@
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, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
17
+ });
18
+ }
19
+ return to;
20
+ };
21
+ var __toCommonJS = (mod) =>
22
+ __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
+ var transpiler_exports = {};
24
+ __export(transpiler_exports, {
25
+ enu: () => import_content_transformers.enu,
26
+ t: () => import_content_transformers.t,
27
+ });
28
+ module.exports = __toCommonJS(transpiler_exports);
29
+ var import_content_transformers = require("./content_transformers/index.cjs");
30
+ // Annotate the CommonJS export names for ESM import in node:
31
+ 0 &&
32
+ (module.exports = {
33
+ enu,
34
+ t,
35
+ });
36
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/transpiler/index.ts"],"sourcesContent":["export type {\n LanguageContent,\n TranslationContent,\n EnumerationContent,\n QuantityContent,\n} from './content_transformers/index';\nexport { t, enu } from './content_transformers/index';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,kCAAuB;","names":[]}
@@ -0,0 +1,13 @@
1
+ export {
2
+ LanguageContent,
3
+ TranslationContent,
4
+ t,
5
+ } from "./content_transformers/translation/translations.js";
6
+ export {
7
+ EnumerationContent,
8
+ QuantityContent,
9
+ enu,
10
+ } from "./content_transformers/enumeration/enumeration.js";
11
+ import "@intlayer/config/client";
12
+ import "../utils/getStackTraceInfo.js";
13
+ import "../types/nodeType.js";
@@ -0,0 +1,21 @@
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 __copyProps = (to, from, except, desc) => {
7
+ if ((from && typeof from === "object") || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, {
11
+ get: () => from[key],
12
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
13
+ });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) =>
18
+ __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var contentModule_exports = {};
20
+ module.exports = __toCommonJS(contentModule_exports);
21
+ //# sourceMappingURL=contentModule.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/types/contentModule.ts"],"sourcesContent":["import type {\n EnumerationContent,\n TranslationContent,\n} from '../transpiler/index';\n\nexport type TypedNode =\n | TranslationContent<unknown>\n | EnumerationContent<unknown>;\n\nexport type ContentValue =\n | string\n | {\n [key: string]: ContentValue;\n }\n | (() => ContentValue)\n | Promise<ContentValue>\n | TypedNode;\n\nexport type Content = Record<string, ContentValue | undefined>;\n\nexport type FlatContentValue =\n | string\n | {\n [key: string]: FlatContentValue;\n }\n | TypedNode;\n\nexport type FlatContent = Record<string, FlatContentValue | undefined>;\n\nexport type ContentModule = Content & {\n id: string;\n};\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1,35 @@
1
+ import { TranslationContent } from "../transpiler/content_transformers/translation/translations.js";
2
+ import { EnumerationContent } from "../transpiler/content_transformers/enumeration/enumeration.js";
3
+ import "./nodeType.js";
4
+ import "@intlayer/config/client";
5
+ import "../utils/getStackTraceInfo.js";
6
+
7
+ type TypedNode = TranslationContent<unknown> | EnumerationContent<unknown>;
8
+ type ContentValue =
9
+ | string
10
+ | {
11
+ [key: string]: ContentValue;
12
+ }
13
+ | (() => ContentValue)
14
+ | Promise<ContentValue>
15
+ | TypedNode;
16
+ type Content = Record<string, ContentValue | undefined>;
17
+ type FlatContentValue =
18
+ | string
19
+ | {
20
+ [key: string]: FlatContentValue;
21
+ }
22
+ | TypedNode;
23
+ type FlatContent = Record<string, FlatContentValue | undefined>;
24
+ type ContentModule = Content & {
25
+ id: string;
26
+ };
27
+
28
+ export type {
29
+ Content,
30
+ ContentModule,
31
+ ContentValue,
32
+ FlatContent,
33
+ FlatContentValue,
34
+ TypedNode,
35
+ };
@@ -0,0 +1,34 @@
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, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
17
+ });
18
+ }
19
+ return to;
20
+ };
21
+ var __toCommonJS = (mod) =>
22
+ __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
+ var types_exports = {};
24
+ __export(types_exports, {
25
+ NodeType: () => import_nodeType.NodeType,
26
+ });
27
+ module.exports = __toCommonJS(types_exports);
28
+ var import_nodeType = require("./nodeType.cjs");
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 &&
31
+ (module.exports = {
32
+ NodeType,
33
+ });
34
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/types/index.ts"],"sourcesContent":["export type {\n ContentValue,\n Content,\n FlatContentValue,\n FlatContent,\n TypedNode,\n ContentModule,\n} from './contentModule';\nexport { NodeType } from './nodeType';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,sBAAyB;","names":[]}
@@ -0,0 +1,13 @@
1
+ export {
2
+ Content,
3
+ ContentModule,
4
+ ContentValue,
5
+ FlatContent,
6
+ FlatContentValue,
7
+ TypedNode,
8
+ } from "./contentModule.js";
9
+ export { NodeType } from "./nodeType.js";
10
+ import "../transpiler/content_transformers/translation/translations.js";
11
+ import "@intlayer/config/client";
12
+ import "../utils/getStackTraceInfo.js";
13
+ import "../transpiler/content_transformers/enumeration/enumeration.js";
@@ -0,0 +1,38 @@
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, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
17
+ });
18
+ }
19
+ return to;
20
+ };
21
+ var __toCommonJS = (mod) =>
22
+ __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
+ var nodeType_exports = {};
24
+ __export(nodeType_exports, {
25
+ NodeType: () => NodeType,
26
+ });
27
+ module.exports = __toCommonJS(nodeType_exports);
28
+ var NodeType = /* @__PURE__ */ ((NodeType2) => {
29
+ NodeType2["Translation"] = "translation";
30
+ NodeType2["Enumeration"] = "enumeration";
31
+ return NodeType2;
32
+ })(NodeType || {});
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 &&
35
+ (module.exports = {
36
+ NodeType,
37
+ });
38
+ //# sourceMappingURL=nodeType.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/types/nodeType.ts"],"sourcesContent":["export enum NodeType {\n Translation = 'translation',\n Enumeration = 'enumeration',\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAK,WAAL,kBAAKA,cAAL;AACL,EAAAA,UAAA,iBAAc;AACd,EAAAA,UAAA,iBAAc;AAFJ,SAAAA;AAAA,GAAA;","names":["NodeType"]}
@@ -0,0 +1,6 @@
1
+ declare enum NodeType {
2
+ Translation = "translation",
3
+ Enumeration = "enumeration",
4
+ }
5
+
6
+ export { NodeType };
@@ -0,0 +1,50 @@
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, {
15
+ get: () => from[key],
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
17
+ });
18
+ }
19
+ return to;
20
+ };
21
+ var __toCommonJS = (mod) =>
22
+ __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
+ var getStackTraceInfo_exports = {};
24
+ __export(getStackTraceInfo_exports, {
25
+ getStackTraceInfo: () => getStackTraceInfo,
26
+ });
27
+ module.exports = __toCommonJS(getStackTraceInfo_exports);
28
+ const getStackTraceInfo = () => {
29
+ const err = new Error();
30
+ const stack = err.stack ?? "";
31
+ const stackLines = stack.split("\n");
32
+ const callerLine = stackLines[2] ?? "";
33
+ const match = callerLine.match(/at\s[^(:]+\([^:]+:(\d+):(\d+)\)?/);
34
+ const line = match?.[1];
35
+ const column = match?.[2];
36
+ if (match) {
37
+ return {
38
+ // file,
39
+ line,
40
+ column,
41
+ };
42
+ }
43
+ return {};
44
+ };
45
+ // Annotate the CommonJS export names for ESM import in node:
46
+ 0 &&
47
+ (module.exports = {
48
+ getStackTraceInfo,
49
+ });
50
+ //# sourceMappingURL=getStackTraceInfo.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/getStackTraceInfo.ts"],"sourcesContent":["export type NoteStackTraceInfo = {\n file?: string;\n line?: string;\n column?: string;\n};\n\n/**\n * Get the file path, line number, and column number of the caller of this function\n * @returns {Object} An object containing file, line, and column numbers\n */\nexport const getStackTraceInfo = (): NoteStackTraceInfo => {\n // Create a new Error object to capture the stack trace\n const err = new Error();\n const stack = err.stack ?? '';\n\n // Split the stack trace into lines and find the line where this function was called\n // Adjust the line index as necessary based on how your environment's stack trace format\n const stackLines = stack.split('\\n');\n const callerLine = stackLines[2] ?? ''; // Adjust the index 2 if needed\n\n // Extract file path, line number, and column number using a regular expression\n // This regex pattern might need adjustments based on your environment\n const match = callerLine.match(/at\\s[^(:]+\\([^:]+:(\\d+):(\\d+)\\)?/);\n\n // const file = match?.[1];\n const line = match?.[1];\n const column = match?.[2];\n\n if (match) {\n return {\n // file,\n line,\n column,\n };\n }\n\n // Return empty object if parsing fails\n return {};\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUO,MAAM,oBAAoB,MAA0B;AAEzD,QAAM,MAAM,IAAI,MAAM;AACtB,QAAM,QAAQ,IAAI,SAAS;AAI3B,QAAM,aAAa,MAAM,MAAM,IAAI;AACnC,QAAM,aAAa,WAAW,CAAC,KAAK;AAIpC,QAAM,QAAQ,WAAW,MAAM,kCAAkC;AAGjE,QAAM,OAAO,QAAQ,CAAC;AACtB,QAAM,SAAS,QAAQ,CAAC;AAExB,MAAI,OAAO;AACT,WAAO;AAAA;AAAA,MAEL;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAGA,SAAO,CAAC;AACV;","names":[]}
@@ -0,0 +1,12 @@
1
+ type NoteStackTraceInfo = {
2
+ file?: string;
3
+ line?: string;
4
+ column?: string;
5
+ };
6
+ /**
7
+ * Get the file path, line number, and column number of the caller of this function
8
+ * @returns {Object} An object containing file, line, and column numbers
9
+ */
10
+ declare const getStackTraceInfo: () => NoteStackTraceInfo;
11
+
12
+ export { type NoteStackTraceInfo, getStackTraceInfo };
@@ -0,0 +1,5 @@
1
+ import { Locales } from "@intlayer/config/client";
2
+
3
+ declare const getLocaleName: (locale: Locales) => string;
4
+
5
+ export { getLocaleName };