@intlayer/core 5.1.6 → 5.1.8

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.
@@ -32,9 +32,9 @@ const getContentNodeByKeyPath = (dictionaryContent, keyPath) => {
32
32
  } else if (keyObj.type === import_types.NodeType.Enumeration) {
33
33
  currentValue = currentValue?.[import_types.NodeType.Enumeration][keyObj.key];
34
34
  } else if (keyObj.type === import_types.NodeType.Condition) {
35
- currentValue = currentValue[import_types.NodeType.Condition];
35
+ currentValue = currentValue?.[import_types.NodeType.Condition];
36
36
  } else if (keyObj.type === import_types.NodeType.Markdown) {
37
- currentValue = currentValue[import_types.NodeType.Markdown];
37
+ currentValue = currentValue?.[import_types.NodeType.Markdown];
38
38
  }
39
39
  }
40
40
  return currentValue;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/dictionaryManipulator/getContentNodeByKeyPath.ts"],"sourcesContent":["import { type KeyPath, NodeType } from '../types';\nimport type { ContentNode } from '../types/dictionary';\n\nexport const getContentNodeByKeyPath = (\n dictionaryContent: ContentNode,\n keyPath: KeyPath[]\n): ContentNode => {\n let currentValue: any = structuredClone(dictionaryContent);\n\n for (const keyObj of keyPath) {\n if (keyObj.type === NodeType.Object || keyObj.type === NodeType.Array) {\n currentValue = currentValue?.[keyObj.key];\n } else if (keyObj.type === NodeType.Translation) {\n currentValue = currentValue?.[NodeType.Translation][keyObj.key];\n } else if (keyObj.type === NodeType.Enumeration) {\n currentValue = currentValue?.[NodeType.Enumeration][keyObj.key];\n } else if (keyObj.type === NodeType.Condition) {\n currentValue = currentValue[NodeType.Condition];\n } else if (keyObj.type === NodeType.Markdown) {\n currentValue = currentValue[NodeType.Markdown];\n }\n }\n\n return currentValue as ContentNode;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAuC;AAGhC,MAAM,0BAA0B,CACrC,mBACA,YACgB;AAChB,MAAI,eAAoB,gBAAgB,iBAAiB;AAEzD,aAAW,UAAU,SAAS;AAC5B,QAAI,OAAO,SAAS,sBAAS,UAAU,OAAO,SAAS,sBAAS,OAAO;AACrE,qBAAe,eAAe,OAAO,GAAG;AAAA,IAC1C,WAAW,OAAO,SAAS,sBAAS,aAAa;AAC/C,qBAAe,eAAe,sBAAS,WAAW,EAAE,OAAO,GAAG;AAAA,IAChE,WAAW,OAAO,SAAS,sBAAS,aAAa;AAC/C,qBAAe,eAAe,sBAAS,WAAW,EAAE,OAAO,GAAG;AAAA,IAChE,WAAW,OAAO,SAAS,sBAAS,WAAW;AAC7C,qBAAe,aAAa,sBAAS,SAAS;AAAA,IAChD,WAAW,OAAO,SAAS,sBAAS,UAAU;AAC5C,qBAAe,aAAa,sBAAS,QAAQ;AAAA,IAC/C;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../src/dictionaryManipulator/getContentNodeByKeyPath.ts"],"sourcesContent":["import { type KeyPath, NodeType } from '../types';\nimport type { ContentNode } from '../types/dictionary';\n\nexport const getContentNodeByKeyPath = (\n dictionaryContent: ContentNode,\n keyPath: KeyPath[]\n): ContentNode => {\n let currentValue: any = structuredClone(dictionaryContent);\n\n for (const keyObj of keyPath) {\n if (keyObj.type === NodeType.Object || keyObj.type === NodeType.Array) {\n currentValue = currentValue?.[keyObj.key];\n } else if (keyObj.type === NodeType.Translation) {\n currentValue = currentValue?.[NodeType.Translation][keyObj.key];\n } else if (keyObj.type === NodeType.Enumeration) {\n currentValue = currentValue?.[NodeType.Enumeration][keyObj.key];\n } else if (keyObj.type === NodeType.Condition) {\n currentValue = currentValue?.[NodeType.Condition];\n } else if (keyObj.type === NodeType.Markdown) {\n currentValue = currentValue?.[NodeType.Markdown];\n }\n }\n\n return currentValue as ContentNode;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAuC;AAGhC,MAAM,0BAA0B,CACrC,mBACA,YACgB;AAChB,MAAI,eAAoB,gBAAgB,iBAAiB;AAEzD,aAAW,UAAU,SAAS;AAC5B,QAAI,OAAO,SAAS,sBAAS,UAAU,OAAO,SAAS,sBAAS,OAAO;AACrE,qBAAe,eAAe,OAAO,GAAG;AAAA,IAC1C,WAAW,OAAO,SAAS,sBAAS,aAAa;AAC/C,qBAAe,eAAe,sBAAS,WAAW,EAAE,OAAO,GAAG;AAAA,IAChE,WAAW,OAAO,SAAS,sBAAS,aAAa;AAC/C,qBAAe,eAAe,sBAAS,WAAW,EAAE,OAAO,GAAG;AAAA,IAChE,WAAW,OAAO,SAAS,sBAAS,WAAW;AAC7C,qBAAe,eAAe,sBAAS,SAAS;AAAA,IAClD,WAAW,OAAO,SAAS,sBAAS,UAAU;AAC5C,qBAAe,eAAe,sBAAS,QAAQ;AAAA,IACjD;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
@@ -9,9 +9,9 @@ const getContentNodeByKeyPath = (dictionaryContent, keyPath) => {
9
9
  } else if (keyObj.type === NodeType.Enumeration) {
10
10
  currentValue = currentValue?.[NodeType.Enumeration][keyObj.key];
11
11
  } else if (keyObj.type === NodeType.Condition) {
12
- currentValue = currentValue[NodeType.Condition];
12
+ currentValue = currentValue?.[NodeType.Condition];
13
13
  } else if (keyObj.type === NodeType.Markdown) {
14
- currentValue = currentValue[NodeType.Markdown];
14
+ currentValue = currentValue?.[NodeType.Markdown];
15
15
  }
16
16
  }
17
17
  return currentValue;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/dictionaryManipulator/getContentNodeByKeyPath.ts"],"sourcesContent":["import { type KeyPath, NodeType } from '../types';\nimport type { ContentNode } from '../types/dictionary';\n\nexport const getContentNodeByKeyPath = (\n dictionaryContent: ContentNode,\n keyPath: KeyPath[]\n): ContentNode => {\n let currentValue: any = structuredClone(dictionaryContent);\n\n for (const keyObj of keyPath) {\n if (keyObj.type === NodeType.Object || keyObj.type === NodeType.Array) {\n currentValue = currentValue?.[keyObj.key];\n } else if (keyObj.type === NodeType.Translation) {\n currentValue = currentValue?.[NodeType.Translation][keyObj.key];\n } else if (keyObj.type === NodeType.Enumeration) {\n currentValue = currentValue?.[NodeType.Enumeration][keyObj.key];\n } else if (keyObj.type === NodeType.Condition) {\n currentValue = currentValue[NodeType.Condition];\n } else if (keyObj.type === NodeType.Markdown) {\n currentValue = currentValue[NodeType.Markdown];\n }\n }\n\n return currentValue as ContentNode;\n};\n"],"mappings":"AAAA,SAAuB,gBAAgB;AAGhC,MAAM,0BAA0B,CACrC,mBACA,YACgB;AAChB,MAAI,eAAoB,gBAAgB,iBAAiB;AAEzD,aAAW,UAAU,SAAS;AAC5B,QAAI,OAAO,SAAS,SAAS,UAAU,OAAO,SAAS,SAAS,OAAO;AACrE,qBAAe,eAAe,OAAO,GAAG;AAAA,IAC1C,WAAW,OAAO,SAAS,SAAS,aAAa;AAC/C,qBAAe,eAAe,SAAS,WAAW,EAAE,OAAO,GAAG;AAAA,IAChE,WAAW,OAAO,SAAS,SAAS,aAAa;AAC/C,qBAAe,eAAe,SAAS,WAAW,EAAE,OAAO,GAAG;AAAA,IAChE,WAAW,OAAO,SAAS,SAAS,WAAW;AAC7C,qBAAe,aAAa,SAAS,SAAS;AAAA,IAChD,WAAW,OAAO,SAAS,SAAS,UAAU;AAC5C,qBAAe,aAAa,SAAS,QAAQ;AAAA,IAC/C;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../src/dictionaryManipulator/getContentNodeByKeyPath.ts"],"sourcesContent":["import { type KeyPath, NodeType } from '../types';\nimport type { ContentNode } from '../types/dictionary';\n\nexport const getContentNodeByKeyPath = (\n dictionaryContent: ContentNode,\n keyPath: KeyPath[]\n): ContentNode => {\n let currentValue: any = structuredClone(dictionaryContent);\n\n for (const keyObj of keyPath) {\n if (keyObj.type === NodeType.Object || keyObj.type === NodeType.Array) {\n currentValue = currentValue?.[keyObj.key];\n } else if (keyObj.type === NodeType.Translation) {\n currentValue = currentValue?.[NodeType.Translation][keyObj.key];\n } else if (keyObj.type === NodeType.Enumeration) {\n currentValue = currentValue?.[NodeType.Enumeration][keyObj.key];\n } else if (keyObj.type === NodeType.Condition) {\n currentValue = currentValue?.[NodeType.Condition];\n } else if (keyObj.type === NodeType.Markdown) {\n currentValue = currentValue?.[NodeType.Markdown];\n }\n }\n\n return currentValue as ContentNode;\n};\n"],"mappings":"AAAA,SAAuB,gBAAgB;AAGhC,MAAM,0BAA0B,CACrC,mBACA,YACgB;AAChB,MAAI,eAAoB,gBAAgB,iBAAiB;AAEzD,aAAW,UAAU,SAAS;AAC5B,QAAI,OAAO,SAAS,SAAS,UAAU,OAAO,SAAS,SAAS,OAAO;AACrE,qBAAe,eAAe,OAAO,GAAG;AAAA,IAC1C,WAAW,OAAO,SAAS,SAAS,aAAa;AAC/C,qBAAe,eAAe,SAAS,WAAW,EAAE,OAAO,GAAG;AAAA,IAChE,WAAW,OAAO,SAAS,SAAS,aAAa;AAC/C,qBAAe,eAAe,SAAS,WAAW,EAAE,OAAO,GAAG;AAAA,IAChE,WAAW,OAAO,SAAS,SAAS,WAAW;AAC7C,qBAAe,eAAe,SAAS,SAAS;AAAA,IAClD,WAAW,OAAO,SAAS,SAAS,UAAU;AAC5C,qBAAe,eAAe,SAAS,QAAQ;AAAA,IACjD;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/core",
3
- "version": "5.1.6",
3
+ "version": "5.1.8",
4
4
  "private": false,
5
5
  "description": "Includes core Intlayer functions like translation, dictionary, and utility functions shared across multiple packages.",
6
6
  "keywords": [
@@ -60,9 +60,9 @@
60
60
  "dependencies": {
61
61
  "@formatjs/intl-localematcher": "^0.5.10",
62
62
  "negotiator": "^1.0.0",
63
- "@intlayer/config": "5.1.6",
64
- "@intlayer/dictionaries-entry": "5.1.6",
65
- "@intlayer/api": "5.1.6"
63
+ "@intlayer/api": "5.1.8",
64
+ "@intlayer/config": "5.1.8",
65
+ "@intlayer/dictionaries-entry": "5.1.8"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@types/negotiator": "^0.6.3",
@@ -81,10 +81,10 @@
81
81
  "@utils/tsup-config": "1.0.4"
82
82
  },
83
83
  "peerDependencies": {
84
- "@intlayer/api": "5.1.6",
85
- "@intlayer/config": "5.1.6",
86
- "intlayer": "5.1.6",
87
- "@intlayer/dictionaries-entry": "5.1.6"
84
+ "@intlayer/api": "5.1.8",
85
+ "@intlayer/config": "5.1.8",
86
+ "@intlayer/dictionaries-entry": "5.1.8",
87
+ "intlayer": "5.1.8"
88
88
  },
89
89
  "engines": {
90
90
  "node": ">=14.18"