@intlayer/core 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/getLocaleName.cjs +8 -13
- package/dist/cjs/getLocaleName.d.ts +1 -1
- package/dist/cjs/index.cjs +20 -27
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.ts +12 -25
- package/dist/cjs/localeList.cjs +9 -14
- package/dist/cjs/localeList.d.ts +1 -1
- package/dist/cjs/transpiler/content_transformers/enumeration/enumeration.cjs +12 -17
- package/dist/cjs/transpiler/content_transformers/enumeration/enumeration.d.ts +6 -15
- package/dist/cjs/transpiler/content_transformers/enumeration/getEnumerationContent.cjs +14 -34
- package/dist/cjs/transpiler/content_transformers/enumeration/getEnumerationContent.d.ts +4 -7
- package/dist/cjs/transpiler/content_transformers/enumeration/index.cjs +11 -23
- package/dist/cjs/transpiler/content_transformers/enumeration/index.d.ts +4 -4
- package/dist/cjs/transpiler/content_transformers/index.cjs +11 -27
- package/dist/cjs/transpiler/content_transformers/index.d.ts +9 -15
- package/dist/cjs/transpiler/content_transformers/translation/getTranslationContent.cjs +9 -15
- package/dist/cjs/transpiler/content_transformers/translation/getTranslationContent.cjs.map +1 -1
- package/dist/cjs/transpiler/content_transformers/translation/getTranslationContent.d.ts +7 -8
- package/dist/cjs/transpiler/content_transformers/translation/index.cjs +13 -23
- package/dist/cjs/transpiler/content_transformers/translation/index.cjs.map +1 -1
- package/dist/cjs/transpiler/content_transformers/translation/index.d.ts +7 -5
- package/dist/cjs/transpiler/content_transformers/translation/{translations.cjs → translation.cjs} +17 -22
- package/dist/cjs/transpiler/content_transformers/translation/translation.cjs.map +1 -0
- package/dist/cjs/transpiler/content_transformers/translation/translation.d.ts +30 -0
- package/dist/cjs/transpiler/content_transformers/translation/types.cjs +17 -0
- package/dist/cjs/transpiler/content_transformers/translation/types.cjs.map +1 -0
- package/dist/cjs/transpiler/content_transformers/translation/types.d.ts +63 -0
- package/dist/cjs/transpiler/index.cjs +9 -22
- package/dist/cjs/transpiler/index.cjs.map +1 -1
- package/dist/cjs/transpiler/index.d.ts +9 -13
- package/dist/cjs/types/contentModule.cjs +4 -8
- package/dist/cjs/types/contentModule.d.ts +14 -28
- package/dist/cjs/types/index.cjs +9 -14
- package/dist/cjs/types/index.d.ts +7 -13
- package/dist/cjs/types/nodeType.cjs +8 -13
- package/dist/cjs/types/nodeType.d.ts +2 -2
- package/dist/cjs/utils/getStackTraceInfo.cjs +9 -14
- package/dist/cjs/utils/getStackTraceInfo.d.ts +3 -3
- package/dist/esm/getLocaleName.d.mts +1 -1
- package/dist/esm/getLocaleName.mjs +4 -2
- package/dist/esm/index.d.mts +12 -25
- package/dist/esm/index.mjs +7 -7
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/localeList.d.mts +1 -1
- package/dist/esm/localeList.mjs +5 -3
- package/dist/esm/transpiler/content_transformers/enumeration/enumeration.d.mts +6 -15
- package/dist/esm/transpiler/content_transformers/enumeration/enumeration.mjs +10 -6
- package/dist/esm/transpiler/content_transformers/enumeration/getEnumerationContent.d.mts +4 -7
- package/dist/esm/transpiler/content_transformers/enumeration/getEnumerationContent.mjs +10 -23
- package/dist/esm/transpiler/content_transformers/enumeration/index.d.mts +4 -4
- package/dist/esm/transpiler/content_transformers/enumeration/index.mjs +3 -3
- package/dist/esm/transpiler/content_transformers/index.d.mts +9 -15
- package/dist/esm/transpiler/content_transformers/index.mjs +3 -3
- package/dist/esm/transpiler/content_transformers/translation/getTranslationContent.d.mts +7 -8
- package/dist/esm/transpiler/content_transformers/translation/getTranslationContent.mjs +8 -5
- package/dist/esm/transpiler/content_transformers/translation/getTranslationContent.mjs.map +1 -1
- package/dist/esm/transpiler/content_transformers/translation/index.d.mts +7 -5
- package/dist/esm/transpiler/content_transformers/translation/index.mjs +4 -3
- package/dist/esm/transpiler/content_transformers/translation/index.mjs.map +1 -1
- package/dist/esm/transpiler/content_transformers/translation/translation.d.mts +30 -0
- package/dist/esm/transpiler/content_transformers/translation/{translations.mjs → translation.mjs} +10 -7
- package/dist/esm/transpiler/content_transformers/translation/translation.mjs.map +1 -0
- package/dist/esm/transpiler/content_transformers/translation/types.d.mts +63 -0
- package/dist/esm/transpiler/content_transformers/translation/types.mjs +1 -0
- package/dist/esm/transpiler/content_transformers/translation/types.mjs.map +1 -0
- package/dist/esm/transpiler/index.d.mts +9 -13
- package/dist/esm/transpiler/index.mjs +2 -3
- package/dist/esm/transpiler/index.mjs.map +1 -1
- package/dist/esm/types/contentModule.d.mts +14 -28
- package/dist/esm/types/contentModule.mjs +1 -1
- package/dist/esm/types/index.d.mts +7 -13
- package/dist/esm/types/index.mjs +5 -3
- package/dist/esm/types/nodeType.d.mts +2 -2
- package/dist/esm/types/nodeType.mjs +4 -2
- package/dist/esm/utils/getStackTraceInfo.d.mts +3 -3
- package/dist/esm/utils/getStackTraceInfo.mjs +5 -3
- package/package.json +8 -5
- package/src/index.ts +2 -0
- package/src/transpiler/content_transformers/translation/getTranslationContent.ts +9 -5
- package/src/transpiler/content_transformers/translation/index.ts +2 -1
- package/src/transpiler/content_transformers/translation/translation.ts +53 -0
- package/src/transpiler/content_transformers/translation/types.ts +72 -0
- package/src/transpiler/index.ts +1 -7
- package/dist/cjs/transpiler/content_transformers/translation/translations.cjs.map +0 -1
- package/dist/cjs/transpiler/content_transformers/translation/translations.d.ts +0 -17
- package/dist/esm/transpiler/content_transformers/translation/translations.d.mts +0 -17
- package/dist/esm/transpiler/content_transformers/translation/translations.mjs.map +0 -1
- package/src/transpiler/content_transformers/translation/translations.ts +0 -42
|
@@ -8,21 +8,17 @@ var __export = (target, all) => {
|
|
|
8
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
9
|
};
|
|
10
10
|
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
12
|
for (let key of __getOwnPropNames(from))
|
|
13
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
|
-
});
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
15
|
}
|
|
19
16
|
return to;
|
|
20
17
|
};
|
|
21
|
-
var __toCommonJS = (mod) =>
|
|
22
|
-
__copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
19
|
var getLocaleName_exports = {};
|
|
24
20
|
__export(getLocaleName_exports, {
|
|
25
|
-
getLocaleName: () => getLocaleName
|
|
21
|
+
getLocaleName: () => getLocaleName
|
|
26
22
|
});
|
|
27
23
|
module.exports = __toCommonJS(getLocaleName_exports);
|
|
28
24
|
var import_client = require("@intlayer/config/client");
|
|
@@ -487,8 +483,7 @@ const getLocaleName = (locale) => {
|
|
|
487
483
|
}
|
|
488
484
|
};
|
|
489
485
|
// Annotate the CommonJS export names for ESM import in node:
|
|
490
|
-
0 &&
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
//# sourceMappingURL=getLocaleName.cjs.map
|
|
486
|
+
0 && (module.exports = {
|
|
487
|
+
getLocaleName
|
|
488
|
+
});
|
|
489
|
+
//# sourceMappingURL=getLocaleName.cjs.map
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -8,44 +8,37 @@ var __export = (target, all) => {
|
|
|
8
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
9
|
};
|
|
10
10
|
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
12
|
for (let key of __getOwnPropNames(from))
|
|
13
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
|
-
});
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
15
|
}
|
|
19
16
|
return to;
|
|
20
17
|
};
|
|
21
|
-
var __toCommonJS = (mod) =>
|
|
22
|
-
__copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
19
|
var src_exports = {};
|
|
24
20
|
__export(src_exports, {
|
|
25
21
|
NodeType: () => import_types.NodeType,
|
|
26
22
|
enu: () => import_content_transformers.enu,
|
|
27
|
-
getEnumerationContent: () =>
|
|
28
|
-
import_content_transformers.getEnumerationContent,
|
|
23
|
+
getEnumerationContent: () => import_content_transformers.getEnumerationContent,
|
|
29
24
|
getLocaleName: () => import_getLocaleName.getLocaleName,
|
|
30
|
-
getTranslationContent: () =>
|
|
31
|
-
import_content_transformers.getTranslationContent,
|
|
25
|
+
getTranslationContent: () => import_content_transformers.getTranslationContent,
|
|
32
26
|
localeList: () => import_localeList.localeList,
|
|
33
|
-
t: () => import_content_transformers.t
|
|
27
|
+
t: () => import_content_transformers.t
|
|
34
28
|
});
|
|
35
29
|
module.exports = __toCommonJS(src_exports);
|
|
36
|
-
var import_content_transformers = require(
|
|
37
|
-
var import_types = require(
|
|
38
|
-
var import_getLocaleName = require(
|
|
39
|
-
var import_localeList = require(
|
|
30
|
+
var import_content_transformers = require('./transpiler/content_transformers/index.cjs');
|
|
31
|
+
var import_types = require('./types/index.cjs');
|
|
32
|
+
var import_getLocaleName = require('./getLocaleName.cjs');
|
|
33
|
+
var import_localeList = require('./localeList.cjs');
|
|
40
34
|
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
-
0 &&
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
//# sourceMappingURL=index.cjs.map
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
NodeType,
|
|
37
|
+
enu,
|
|
38
|
+
getEnumerationContent,
|
|
39
|
+
getLocaleName,
|
|
40
|
+
getTranslationContent,
|
|
41
|
+
localeList,
|
|
42
|
+
t
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=index.cjs.map
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export type {\n LanguageContent,\n TranslationContent,\n EnumerationContent,\n QuantityContent,\n} from './transpiler/content_transformers/index';\nexport {\n t,\n enu,\n getTranslationContent,\n getEnumerationContent,\n} from './transpiler/content_transformers/index';\nexport type {\n ContentValue,\n Content,\n FlatContentValue,\n FlatContent,\n TypedNode,\n ContentModule,\n} from './types/index';\nexport { NodeType } from './types/index';\nexport { getLocaleName } from './getLocaleName';\nexport { localeList } from './localeList';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
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 getEnumerationContent,\n} from './transpiler/content_transformers/index';\nexport type {\n ContentValue,\n Content,\n FlatContentValue,\n FlatContent,\n TypedNode,\n ContentModule,\n} from './types/index';\nexport { NodeType } from './types/index';\nexport { getLocaleName } from './getLocaleName';\nexport { localeList } from './localeList';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,kCAKO;AASP,mBAAyB;AACzB,2BAA8B;AAC9B,wBAA2B;","names":[]}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,25 +1,12 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
Content,
|
|
15
|
-
ContentModule,
|
|
16
|
-
ContentValue,
|
|
17
|
-
FlatContent,
|
|
18
|
-
FlatContentValue,
|
|
19
|
-
TypedNode,
|
|
20
|
-
} from "./types/contentModule.js";
|
|
21
|
-
export { NodeType } from "./types/nodeType.js";
|
|
22
|
-
export { getLocaleName } from "./getLocaleName.js";
|
|
23
|
-
export { localeList } from "./localeList.js";
|
|
24
|
-
import "@intlayer/config/client";
|
|
25
|
-
import "./utils/getStackTraceInfo.js";
|
|
1
|
+
export { t } from './transpiler/content_transformers/translation/translation.js';
|
|
2
|
+
export { getTranslationContent } from './transpiler/content_transformers/translation/getTranslationContent.js';
|
|
3
|
+
export { CustomizableLanguageContent, LanguageContent, CustomLocales as Locales, TranslationContent } from './transpiler/content_transformers/translation/types.js';
|
|
4
|
+
export { EnumerationContent, QuantityContent, enu } from './transpiler/content_transformers/enumeration/enumeration.js';
|
|
5
|
+
export { getEnumerationContent } from './transpiler/content_transformers/enumeration/getEnumerationContent.js';
|
|
6
|
+
export { Content, ContentModule, ContentValue, FlatContent, FlatContentValue, TypedNode } from './types/contentModule.js';
|
|
7
|
+
export { NodeType } from './types/nodeType.js';
|
|
8
|
+
export { getLocaleName } from './getLocaleName.js';
|
|
9
|
+
export { localeList } from './localeList.js';
|
|
10
|
+
import '@intlayer/config/client';
|
|
11
|
+
import 'intlayer';
|
|
12
|
+
import './utils/getStackTraceInfo.js';
|
package/dist/cjs/localeList.cjs
CHANGED
|
@@ -8,21 +8,17 @@ var __export = (target, all) => {
|
|
|
8
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
9
|
};
|
|
10
10
|
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
12
|
for (let key of __getOwnPropNames(from))
|
|
13
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
|
-
});
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
15
|
}
|
|
19
16
|
return to;
|
|
20
17
|
};
|
|
21
|
-
var __toCommonJS = (mod) =>
|
|
22
|
-
__copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
19
|
var localeList_exports = {};
|
|
24
20
|
__export(localeList_exports, {
|
|
25
|
-
localeList: () => localeList
|
|
21
|
+
localeList: () => localeList
|
|
26
22
|
});
|
|
27
23
|
module.exports = __toCommonJS(localeList_exports);
|
|
28
24
|
var import_client = require("@intlayer/config/client");
|
|
@@ -251,11 +247,10 @@ const localeList = [
|
|
|
251
247
|
import_client.Locales.CHINESE_MACAU,
|
|
252
248
|
import_client.Locales.CHINESE_SINGAPORE,
|
|
253
249
|
import_client.Locales.CHINESE_TRADITIONAL,
|
|
254
|
-
import_client.Locales.ZULU_SOUTH_AFRICA
|
|
250
|
+
import_client.Locales.ZULU_SOUTH_AFRICA
|
|
255
251
|
];
|
|
256
252
|
// Annotate the CommonJS export names for ESM import in node:
|
|
257
|
-
0 &&
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
//# sourceMappingURL=localeList.cjs.map
|
|
253
|
+
0 && (module.exports = {
|
|
254
|
+
localeList
|
|
255
|
+
});
|
|
256
|
+
//# sourceMappingURL=localeList.cjs.map
|
package/dist/cjs/localeList.d.ts
CHANGED
|
@@ -8,45 +8,40 @@ var __export = (target, all) => {
|
|
|
8
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
9
|
};
|
|
10
10
|
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
12
|
for (let key of __getOwnPropNames(from))
|
|
13
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
|
-
});
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
15
|
}
|
|
19
16
|
return to;
|
|
20
17
|
};
|
|
21
|
-
var __toCommonJS = (mod) =>
|
|
22
|
-
__copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
19
|
var enumeration_exports = {};
|
|
24
20
|
__export(enumeration_exports, {
|
|
25
|
-
enu: () => enumeration
|
|
21
|
+
enu: () => enumeration
|
|
26
22
|
});
|
|
27
23
|
module.exports = __toCommonJS(enumeration_exports);
|
|
28
|
-
var import_types = require(
|
|
29
|
-
var import_getStackTraceInfo = require(
|
|
24
|
+
var import_types = require('../../../types/index.cjs');
|
|
25
|
+
var import_getStackTraceInfo = require('../../../utils/getStackTraceInfo.cjs');
|
|
30
26
|
const enumeration = (content) => {
|
|
31
27
|
const stackTraceInfo = (0, import_getStackTraceInfo.getStackTraceInfo)();
|
|
32
28
|
if (typeof content === "string") {
|
|
33
29
|
const result2 = {
|
|
34
30
|
nodeType: import_types.NodeType.Enumeration,
|
|
35
31
|
...stackTraceInfo,
|
|
36
|
-
1: content
|
|
32
|
+
1: content
|
|
37
33
|
};
|
|
38
34
|
return result2;
|
|
39
35
|
}
|
|
40
36
|
const result = {
|
|
41
37
|
nodeType: import_types.NodeType.Enumeration,
|
|
42
38
|
...stackTraceInfo,
|
|
43
|
-
...content
|
|
39
|
+
...content
|
|
44
40
|
};
|
|
45
41
|
return result;
|
|
46
42
|
};
|
|
47
43
|
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
-
0 &&
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
//# sourceMappingURL=enumeration.cjs.map
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
enu
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=enumeration.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NoteStackTraceInfo } from
|
|
2
|
-
import { NodeType } from
|
|
1
|
+
import { NoteStackTraceInfo } from '../../../utils/getStackTraceInfo.js';
|
|
2
|
+
import { NodeType } from '../../../types/nodeType.js';
|
|
3
3
|
|
|
4
4
|
type Positif = number | `${number}`;
|
|
5
5
|
type Negatif = `-${number}`;
|
|
@@ -10,23 +10,14 @@ type Superior = `>${Numbers}`;
|
|
|
10
10
|
type SuperiorOrEqual = `>=${Numbers}`;
|
|
11
11
|
type Inferior = `<${Numbers}`;
|
|
12
12
|
type InferiorOrEqual = `<=${Numbers}`;
|
|
13
|
-
type EnterFormat =
|
|
14
|
-
| Equal
|
|
15
|
-
| EqualString
|
|
16
|
-
| Superior
|
|
17
|
-
| SuperiorOrEqual
|
|
18
|
-
| Inferior
|
|
19
|
-
| InferiorOrEqual;
|
|
13
|
+
type EnterFormat = Equal | EqualString | Superior | SuperiorOrEqual | Inferior | InferiorOrEqual;
|
|
20
14
|
type QuantityContent<Content> = Record<EnterFormat, Content>;
|
|
21
|
-
type EnumerationContent<Content> = Partial<QuantityContent<Content>> &
|
|
22
|
-
NoteStackTraceInfo & {
|
|
15
|
+
type EnumerationContent<Content> = Partial<QuantityContent<Content>> & NoteStackTraceInfo & {
|
|
23
16
|
nodeType: NodeType.Enumeration;
|
|
24
|
-
|
|
17
|
+
};
|
|
25
18
|
/**
|
|
26
19
|
* Create a JSON string with the content and the stack trace information
|
|
27
20
|
*/
|
|
28
|
-
declare const enumeration: <Content>(
|
|
29
|
-
content?: Partial<QuantityContent<Content>>
|
|
30
|
-
) => EnumerationContent<Content>;
|
|
21
|
+
declare const enumeration: <Content>(content?: Partial<QuantityContent<Content>>) => EnumerationContent<Content>;
|
|
31
22
|
|
|
32
23
|
export { type EnumerationContent, type QuantityContent, enumeration as enu };
|
|
@@ -8,55 +8,35 @@ var __export = (target, all) => {
|
|
|
8
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
9
|
};
|
|
10
10
|
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
12
|
for (let key of __getOwnPropNames(from))
|
|
13
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
|
-
});
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
15
|
}
|
|
19
16
|
return to;
|
|
20
17
|
};
|
|
21
|
-
var __toCommonJS = (mod) =>
|
|
22
|
-
__copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
19
|
var getEnumerationContent_exports = {};
|
|
24
20
|
__export(getEnumerationContent_exports, {
|
|
25
|
-
getEnumerationContent: () => getEnumerationContent
|
|
21
|
+
getEnumerationContent: () => getEnumerationContent
|
|
26
22
|
});
|
|
27
23
|
module.exports = __toCommonJS(getEnumerationContent_exports);
|
|
28
24
|
const getEnumerationContent = (enumerationContent, quantity) => {
|
|
29
25
|
const numericKeys = Object.keys(enumerationContent);
|
|
30
26
|
for (const key of numericKeys) {
|
|
31
|
-
const isEqual =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const isSuperior =
|
|
38
|
-
key.startsWith(">") && quantity > parseFloat(key.slice(1));
|
|
39
|
-
const isSuperiorOrEqual =
|
|
40
|
-
key.startsWith(">=") && quantity >= parseFloat(key.slice(2));
|
|
41
|
-
const isInferior =
|
|
42
|
-
key.startsWith("<") && quantity < parseFloat(key.slice(1));
|
|
43
|
-
const isInferiorOrEqual =
|
|
44
|
-
key.startsWith("<=") && quantity <= parseFloat(key.slice(2));
|
|
45
|
-
if (
|
|
46
|
-
isEqual ||
|
|
47
|
-
isSuperior ||
|
|
48
|
-
isSuperiorOrEqual ||
|
|
49
|
-
isInferior ||
|
|
50
|
-
isInferiorOrEqual
|
|
51
|
-
) {
|
|
27
|
+
const isEqual = !key.startsWith(">") && !key.startsWith("<") && !key.startsWith("=") && parseFloat(key) === quantity || key.startsWith("=") && parseFloat(key.slice(1)) === quantity;
|
|
28
|
+
const isSuperior = key.startsWith(">") && quantity > parseFloat(key.slice(1));
|
|
29
|
+
const isSuperiorOrEqual = key.startsWith(">=") && quantity >= parseFloat(key.slice(2));
|
|
30
|
+
const isInferior = key.startsWith("<") && quantity < parseFloat(key.slice(1));
|
|
31
|
+
const isInferiorOrEqual = key.startsWith("<=") && quantity <= parseFloat(key.slice(2));
|
|
32
|
+
if (isEqual || isSuperior || isSuperiorOrEqual || isInferior || isInferiorOrEqual) {
|
|
52
33
|
return enumerationContent[key];
|
|
53
34
|
}
|
|
54
35
|
}
|
|
55
36
|
return enumerationContent["1"];
|
|
56
37
|
};
|
|
57
38
|
// Annotate the CommonJS export names for ESM import in node:
|
|
58
|
-
0 &&
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
//# sourceMappingURL=getEnumerationContent.cjs.map
|
|
39
|
+
0 && (module.exports = {
|
|
40
|
+
getEnumerationContent
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=getEnumerationContent.cjs.map
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { QuantityContent } from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { QuantityContent } from './enumeration.js';
|
|
2
|
+
import '../../../utils/getStackTraceInfo.js';
|
|
3
|
+
import '../../../types/nodeType.js';
|
|
4
4
|
|
|
5
|
-
declare const getEnumerationContent: <Content>(
|
|
6
|
-
enumerationContent: QuantityContent<Content>,
|
|
7
|
-
quantity: number
|
|
8
|
-
) => Content;
|
|
5
|
+
declare const getEnumerationContent: <Content>(enumerationContent: QuantityContent<Content>, quantity: number) => Content;
|
|
9
6
|
|
|
10
7
|
export { getEnumerationContent };
|
|
@@ -4,34 +4,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
6
|
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
8
|
for (let key of __getOwnPropNames(from))
|
|
9
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
|
-
});
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
11
|
}
|
|
15
12
|
return to;
|
|
16
13
|
};
|
|
17
|
-
var __reExport = (target, mod, secondTarget) => (
|
|
18
|
-
|
|
19
|
-
secondTarget && __copyProps(secondTarget, mod, "default")
|
|
20
|
-
);
|
|
21
|
-
var __toCommonJS = (mod) =>
|
|
22
|
-
__copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
16
|
var enumeration_exports = {};
|
|
24
17
|
module.exports = __toCommonJS(enumeration_exports);
|
|
25
|
-
__reExport(enumeration_exports, require(
|
|
26
|
-
__reExport(
|
|
27
|
-
enumeration_exports,
|
|
28
|
-
require("./getEnumerationContent.cjs"),
|
|
29
|
-
module.exports
|
|
30
|
-
);
|
|
18
|
+
__reExport(enumeration_exports, require('./enumeration.cjs'), module.exports);
|
|
19
|
+
__reExport(enumeration_exports, require('./getEnumerationContent.cjs'), module.exports);
|
|
31
20
|
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
-
0 &&
|
|
33
|
-
(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
//# sourceMappingURL=index.cjs.map
|
|
21
|
+
0 && (module.exports = {
|
|
22
|
+
...require('./enumeration.cjs'),
|
|
23
|
+
...require('./getEnumerationContent.cjs')
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { EnumerationContent, QuantityContent, enu } from
|
|
2
|
-
export { getEnumerationContent } from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
export { EnumerationContent, QuantityContent, enu } from './enumeration.js';
|
|
2
|
+
export { getEnumerationContent } from './getEnumerationContent.js';
|
|
3
|
+
import '../../../utils/getStackTraceInfo.js';
|
|
4
|
+
import '../../../types/nodeType.js';
|
|
@@ -4,38 +4,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
6
|
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
8
|
for (let key of __getOwnPropNames(from))
|
|
9
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
|
-
});
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
11
|
}
|
|
15
12
|
return to;
|
|
16
13
|
};
|
|
17
|
-
var __reExport = (target, mod, secondTarget) => (
|
|
18
|
-
|
|
19
|
-
secondTarget && __copyProps(secondTarget, mod, "default")
|
|
20
|
-
);
|
|
21
|
-
var __toCommonJS = (mod) =>
|
|
22
|
-
__copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
16
|
var content_transformers_exports = {};
|
|
24
17
|
module.exports = __toCommonJS(content_transformers_exports);
|
|
25
|
-
__reExport(
|
|
26
|
-
|
|
27
|
-
require("./translation/index.cjs"),
|
|
28
|
-
module.exports
|
|
29
|
-
);
|
|
30
|
-
__reExport(
|
|
31
|
-
content_transformers_exports,
|
|
32
|
-
require("./enumeration/index.cjs"),
|
|
33
|
-
module.exports
|
|
34
|
-
);
|
|
18
|
+
__reExport(content_transformers_exports, require('./translation/index.cjs'), module.exports);
|
|
19
|
+
__reExport(content_transformers_exports, require('./enumeration/index.cjs'), module.exports);
|
|
35
20
|
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
-
0 &&
|
|
37
|
-
(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
//# sourceMappingURL=index.cjs.map
|
|
21
|
+
0 && (module.exports = {
|
|
22
|
+
...require('./translation/index.cjs'),
|
|
23
|
+
...require('./enumeration/index.cjs')
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
enu,
|
|
11
|
-
} from "./enumeration/enumeration.js";
|
|
12
|
-
export { getEnumerationContent } from "./enumeration/getEnumerationContent.js";
|
|
13
|
-
import "@intlayer/config/client";
|
|
14
|
-
import "../../utils/getStackTraceInfo.js";
|
|
15
|
-
import "../../types/nodeType.js";
|
|
1
|
+
export { t } from './translation/translation.js';
|
|
2
|
+
export { getTranslationContent } from './translation/getTranslationContent.js';
|
|
3
|
+
export { ConfigLanguageContent, ConfigLocales, CustomLocales, CustomizableLanguageContent, LanguageContent, TranslationContent } from './translation/types.js';
|
|
4
|
+
export { EnumerationContent, QuantityContent, enu } from './enumeration/enumeration.js';
|
|
5
|
+
export { getEnumerationContent } from './enumeration/getEnumerationContent.js';
|
|
6
|
+
import '@intlayer/config/client';
|
|
7
|
+
import 'intlayer';
|
|
8
|
+
import '../../utils/getStackTraceInfo.js';
|
|
9
|
+
import '../../types/nodeType.js';
|
|
@@ -8,30 +8,24 @@ var __export = (target, all) => {
|
|
|
8
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
9
|
};
|
|
10
10
|
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
12
|
for (let key of __getOwnPropNames(from))
|
|
13
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
|
-
});
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
15
|
}
|
|
19
16
|
return to;
|
|
20
17
|
};
|
|
21
|
-
var __toCommonJS = (mod) =>
|
|
22
|
-
__copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
19
|
var getTranslationContent_exports = {};
|
|
24
20
|
__export(getTranslationContent_exports, {
|
|
25
|
-
getTranslationContent: () => getTranslationContent
|
|
21
|
+
getTranslationContent: () => getTranslationContent
|
|
26
22
|
});
|
|
27
23
|
module.exports = __toCommonJS(getTranslationContent_exports);
|
|
28
24
|
var import_client = require("@intlayer/config/client");
|
|
29
25
|
const defaultLocale = import_client.intlayerIntlConfiguration.defaultLocale;
|
|
30
|
-
const getTranslationContent = (languageContent, locale) =>
|
|
31
|
-
languageContent[locale ?? defaultLocale] ?? languageContent[defaultLocale];
|
|
26
|
+
const getTranslationContent = (languageContent, locale) => languageContent[locale ?? defaultLocale] ?? languageContent[defaultLocale];
|
|
32
27
|
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
-
0 &&
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
//# sourceMappingURL=getTranslationContent.cjs.map
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
getTranslationContent
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=getTranslationContent.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/transpiler/content_transformers/translation/getTranslationContent.ts"],"sourcesContent":["import {\n type Locales,\n intlayerIntlConfiguration,\n} from '@intlayer/config/client';\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../../../../src/transpiler/content_transformers/translation/getTranslationContent.ts"],"sourcesContent":["import {\n type Locales,\n intlayerIntlConfiguration,\n} from '@intlayer/config/client';\nimport type { CustomizableLanguageContent } from './types';\n\nconst defaultLocale = intlayerIntlConfiguration.defaultLocale;\n\ntype GetTranslationContent = <Content = string>(\n languageContent: CustomizableLanguageContent<Content>,\n locale: Locales\n) => Content;\n\nexport const getTranslationContent: GetTranslationContent = <Content = string>(\n languageContent: CustomizableLanguageContent<Content>,\n locale: Locales\n) => languageContent[locale ?? defaultLocale] ?? languageContent[defaultLocale];\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAGO;AAGP,MAAM,gBAAgB,wCAA0B;AAOzC,MAAM,wBAA+C,CAC1D,iBACA,WACG,gBAAgB,UAAU,aAAa,KAAK,gBAAgB,aAAa;","names":[]}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { Locales } from '@intlayer/config/client';
|
|
2
|
+
import { CustomizableLanguageContent } from './types.js';
|
|
3
|
+
import 'intlayer';
|
|
4
|
+
import '../../../utils/getStackTraceInfo.js';
|
|
5
|
+
import '../../../types/nodeType.js';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
locale: Locales
|
|
9
|
-
) => Content;
|
|
7
|
+
type GetTranslationContent = <Content = string>(languageContent: CustomizableLanguageContent<Content>, locale: Locales) => Content;
|
|
8
|
+
declare const getTranslationContent: GetTranslationContent;
|
|
10
9
|
|
|
11
10
|
export { getTranslationContent };
|