@intlayer/core 5.1.2 → 5.1.4

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.
@@ -26,6 +26,9 @@ const editDictionaryByKeyPath = (dictionaryContent, keyPath, newValue) => {
26
26
  let currentValue = dictionaryContent;
27
27
  let parentValue = null;
28
28
  let lastKeys = [];
29
+ if (keyPath.length === 0) {
30
+ return newValue;
31
+ }
29
32
  for (let i = 0; i < keyPath.length; i++) {
30
33
  const keyObj = keyPath[i];
31
34
  parentValue = currentValue;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/dictionaryManipulator/editDictionaryByKeyPath.ts"],"sourcesContent":["import { type KeyPath, NodeType } from '../types';\nimport type { ContentNode } from '../types/dictionary';\n\ntype LastKeyType = string | number;\n\nexport const editDictionaryByKeyPath = (\n dictionaryContent: ContentNode,\n keyPath: KeyPath[],\n newValue: ContentNode\n): ContentNode => {\n let currentValue: any = dictionaryContent;\n let parentValue: any = null;\n let lastKeys: LastKeyType[] = [];\n\n for (let i = 0; i < keyPath.length; i++) {\n const keyObj = keyPath[i];\n parentValue = currentValue;\n\n if (keyObj.type === NodeType.Object) {\n lastKeys = [keyObj.key];\n if (\n !currentValue[keyObj.key] ||\n typeof currentValue[keyObj.key] !== 'object'\n ) {\n currentValue[keyObj.key] = {};\n }\n currentValue = currentValue[keyObj.key];\n } else if (keyObj.type === NodeType.Array) {\n lastKeys = [keyObj.key];\n if (\n !currentValue[keyObj.key] ||\n typeof currentValue[keyObj.key] !== 'object'\n ) {\n currentValue[keyObj.key] = {};\n }\n currentValue = currentValue[keyObj.key];\n } else if (keyObj.type === NodeType.Translation) {\n lastKeys = [NodeType.Translation, keyObj.key];\n if (\n !currentValue[NodeType.Translation] ||\n typeof currentValue[NodeType.Translation] !== 'object'\n ) {\n currentValue[NodeType.Translation] = {};\n }\n if (\n !currentValue[NodeType.Translation][keyObj.key] ||\n typeof currentValue[NodeType.Translation][keyObj.key] !== 'object'\n ) {\n currentValue[NodeType.Translation][keyObj.key] = {};\n }\n currentValue = currentValue[NodeType.Translation][keyObj.key];\n } else if (keyObj.type === NodeType.Enumeration) {\n lastKeys = [NodeType.Enumeration, keyObj.key];\n if (\n !currentValue[NodeType.Enumeration] ||\n typeof currentValue[NodeType.Enumeration] !== 'object'\n ) {\n currentValue[NodeType.Enumeration] = {};\n }\n if (\n !currentValue[NodeType.Enumeration][keyObj.key] ||\n typeof currentValue[NodeType.Enumeration][keyObj.key] !== 'object'\n ) {\n currentValue[NodeType.Enumeration][keyObj.key] = {};\n }\n currentValue = currentValue[NodeType.Enumeration][keyObj.key];\n } else if (keyObj.type === NodeType.Condition) {\n lastKeys = [NodeType.Condition, keyObj.key];\n if (\n !currentValue[NodeType.Condition] ||\n typeof currentValue[NodeType.Condition] !== 'object'\n ) {\n currentValue[NodeType.Condition] = {};\n }\n if (\n !currentValue[NodeType.Condition][keyObj.key] ||\n typeof currentValue[NodeType.Condition][keyObj.key] !== 'object'\n ) {\n currentValue[NodeType.Condition][keyObj.key] = {};\n }\n currentValue = currentValue[NodeType.Condition][keyObj.key];\n } else if (keyObj.type === NodeType.Markdown) {\n lastKeys = [NodeType.Markdown];\n if (\n !currentValue[NodeType.Markdown] ||\n typeof currentValue[NodeType.Markdown] !== 'object'\n ) {\n currentValue[NodeType.Markdown] = '';\n }\n currentValue = currentValue[NodeType.Markdown];\n } else if (keyObj.type === NodeType.Nested) {\n lastKeys = [NodeType.Nested];\n if (\n !currentValue[NodeType.Nested] ||\n typeof currentValue[NodeType.Nested] !== 'object'\n ) {\n currentValue[NodeType.Nested] = {};\n }\n currentValue = currentValue[NodeType.Nested];\n }\n\n // Only update the value when processing the last key in the keyPath.\n if (i === keyPath.length - 1 && parentValue && lastKeys.length > 0) {\n let target = parentValue;\n // Drill down if lastKeys contains more than one key.\n for (const key of lastKeys.slice(0, -1)) {\n target = target[key];\n }\n if (typeof newValue === 'undefined') {\n delete target[lastKeys[lastKeys.length - 1]];\n } else {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AAC,sBAAS,MAAM;AAC3B,UACE,CAAC,aAAa,sBAAS,MAAM,KAC7B,OAAO,aAAa,sBAAS,MAAM,MAAM,UACzC;AACA,qBAAa,sBAAS,MAAM,IAAI,CAAC;AAAA,MACnC;AACA,qBAAe,aAAa,sBAAS,MAAM;AAAA,IAC7C;AAGA,QAAI,MAAM,QAAQ,SAAS,KAAK,eAAe,SAAS,SAAS,GAAG;AAClE,UAAI,SAAS;AAEb,iBAAW,OAAO,SAAS,MAAM,GAAG,EAAE,GAAG;AACvC,iBAAS,OAAO,GAAG;AAAA,MACrB;AACA,UAAI,OAAO,aAAa,aAAa;AACnC,eAAO,OAAO,SAAS,SAAS,SAAS,CAAC,CAAC;AAAA,MAC7C,OAAO;AACL,eAAO,SAAS,SAAS,SAAS,CAAC,CAAC,IAAI;AAAA,MAC1C;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../src/dictionaryManipulator/editDictionaryByKeyPath.ts"],"sourcesContent":["import { type KeyPath, NodeType } from '../types';\nimport type { ContentNode } from '../types/dictionary';\n\ntype LastKeyType = string | number;\n\nexport const editDictionaryByKeyPath = (\n dictionaryContent: ContentNode,\n keyPath: KeyPath[],\n newValue: ContentNode\n): ContentNode => {\n let currentValue: any = dictionaryContent;\n let parentValue: any = null;\n let lastKeys: LastKeyType[] = [];\n\n if (keyPath.length === 0) {\n return newValue;\n }\n\n for (let i = 0; i < keyPath.length; i++) {\n const keyObj = keyPath[i];\n parentValue = currentValue;\n\n if (keyObj.type === NodeType.Object) {\n lastKeys = [keyObj.key];\n if (\n !currentValue[keyObj.key] ||\n typeof currentValue[keyObj.key] !== 'object'\n ) {\n currentValue[keyObj.key] = {};\n }\n currentValue = currentValue[keyObj.key];\n } else if (keyObj.type === NodeType.Array) {\n lastKeys = [keyObj.key];\n if (\n !currentValue[keyObj.key] ||\n typeof currentValue[keyObj.key] !== 'object'\n ) {\n currentValue[keyObj.key] = {};\n }\n currentValue = currentValue[keyObj.key];\n } else if (keyObj.type === NodeType.Translation) {\n lastKeys = [NodeType.Translation, keyObj.key];\n if (\n !currentValue[NodeType.Translation] ||\n typeof currentValue[NodeType.Translation] !== 'object'\n ) {\n currentValue[NodeType.Translation] = {};\n }\n if (\n !currentValue[NodeType.Translation][keyObj.key] ||\n typeof currentValue[NodeType.Translation][keyObj.key] !== 'object'\n ) {\n currentValue[NodeType.Translation][keyObj.key] = {};\n }\n currentValue = currentValue[NodeType.Translation][keyObj.key];\n } else if (keyObj.type === NodeType.Enumeration) {\n lastKeys = [NodeType.Enumeration, keyObj.key];\n if (\n !currentValue[NodeType.Enumeration] ||\n typeof currentValue[NodeType.Enumeration] !== 'object'\n ) {\n currentValue[NodeType.Enumeration] = {};\n }\n if (\n !currentValue[NodeType.Enumeration][keyObj.key] ||\n typeof currentValue[NodeType.Enumeration][keyObj.key] !== 'object'\n ) {\n currentValue[NodeType.Enumeration][keyObj.key] = {};\n }\n currentValue = currentValue[NodeType.Enumeration][keyObj.key];\n } else if (keyObj.type === NodeType.Condition) {\n lastKeys = [NodeType.Condition, keyObj.key];\n if (\n !currentValue[NodeType.Condition] ||\n typeof currentValue[NodeType.Condition] !== 'object'\n ) {\n currentValue[NodeType.Condition] = {};\n }\n if (\n !currentValue[NodeType.Condition][keyObj.key] ||\n typeof currentValue[NodeType.Condition][keyObj.key] !== 'object'\n ) {\n currentValue[NodeType.Condition][keyObj.key] = {};\n }\n currentValue = currentValue[NodeType.Condition][keyObj.key];\n } else if (keyObj.type === NodeType.Markdown) {\n lastKeys = [NodeType.Markdown];\n if (\n !currentValue[NodeType.Markdown] ||\n typeof currentValue[NodeType.Markdown] !== 'object'\n ) {\n currentValue[NodeType.Markdown] = '';\n }\n currentValue = currentValue[NodeType.Markdown];\n } else if (keyObj.type === NodeType.Nested) {\n lastKeys = [NodeType.Nested];\n if (\n !currentValue[NodeType.Nested] ||\n typeof currentValue[NodeType.Nested] !== 'object'\n ) {\n currentValue[NodeType.Nested] = {};\n }\n currentValue = currentValue[NodeType.Nested];\n }\n\n // Only update the value when processing the last key in the keyPath.\n if (i === keyPath.length - 1 && parentValue && lastKeys.length > 0) {\n let target = parentValue;\n // Drill down if lastKeys contains more than one key.\n for (const key of lastKeys.slice(0, -1)) {\n target = target[key];\n }\n if (typeof newValue === 'undefined') {\n delete target[lastKeys[lastKeys.length - 1]];\n } else {\n target[lastKeys[lastKeys.length - 1]] = newValue;\n }\n }\n }\n return dictionaryContent;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAuC;AAKhC,MAAM,0BAA0B,CACrC,mBACA,SACA,aACgB;AAChB,MAAI,eAAoB;AACxB,MAAI,cAAmB;AACvB,MAAI,WAA0B,CAAC;AAE/B,MAAI,QAAQ,WAAW,GAAG;AACxB,WAAO;AAAA,EACT;AAEA,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,SAAS,QAAQ,CAAC;AACxB,kBAAc;AAEd,QAAI,OAAO,SAAS,sBAAS,QAAQ;AACnC,iBAAW,CAAC,OAAO,GAAG;AACtB,UACE,CAAC,aAAa,OAAO,GAAG,KACxB,OAAO,aAAa,OAAO,GAAG,MAAM,UACpC;AACA,qBAAa,OAAO,GAAG,IAAI,CAAC;AAAA,MAC9B;AACA,qBAAe,aAAa,OAAO,GAAG;AAAA,IACxC,WAAW,OAAO,SAAS,sBAAS,OAAO;AACzC,iBAAW,CAAC,OAAO,GAAG;AACtB,UACE,CAAC,aAAa,OAAO,GAAG,KACxB,OAAO,aAAa,OAAO,GAAG,MAAM,UACpC;AACA,qBAAa,OAAO,GAAG,IAAI,CAAC;AAAA,MAC9B;AACA,qBAAe,aAAa,OAAO,GAAG;AAAA,IACxC,WAAW,OAAO,SAAS,sBAAS,aAAa;AAC/C,iBAAW,CAAC,sBAAS,aAAa,OAAO,GAAG;AAC5C,UACE,CAAC,aAAa,sBAAS,WAAW,KAClC,OAAO,aAAa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WAAW,OAAO,SAAS,sBAAS,UAAU;AAC5C,iBAAW,CAAC,sBAAS,QAAQ;AAC7B,UACE,CAAC,aAAa,sBAAS,QAAQ,KAC/B,OAAO,aAAa,sBAAS,QAAQ,MAAM,UAC3C;AACA,qBAAa,sBAAS,QAAQ,IAAI;AAAA,MACpC;AACA,qBAAe,aAAa,sBAAS,QAAQ;AAAA,IAC/C,WAAW,OAAO,SAAS,sBAAS,QAAQ;AAC1C,iBAAW,CAAC,sBAAS,MAAM;AAC3B,UACE,CAAC,aAAa,sBAAS,MAAM,KAC7B,OAAO,aAAa,sBAAS,MAAM,MAAM,UACzC;AACA,qBAAa,sBAAS,MAAM,IAAI,CAAC;AAAA,MACnC;AACA,qBAAe,aAAa,sBAAS,MAAM;AAAA,IAC7C;AAGA,QAAI,MAAM,QAAQ,SAAS,KAAK,eAAe,SAAS,SAAS,GAAG;AAClE,UAAI,SAAS;AAEb,iBAAW,OAAO,SAAS,MAAM,GAAG,EAAE,GAAG;AACvC,iBAAS,OAAO,GAAG;AAAA,MACrB;AACA,UAAI,OAAO,aAAa,aAAa;AACnC,eAAO,OAAO,SAAS,SAAS,SAAS,CAAC,CAAC;AAAA,MAC7C,OAAO;AACL,eAAO,SAAS,SAAS,SAAS,CAAC,CAAC,IAAI;AAAA,MAC1C;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
@@ -23,7 +23,7 @@ __export(getContentNodeByKeyPath_exports, {
23
23
  module.exports = __toCommonJS(getContentNodeByKeyPath_exports);
24
24
  var import_types = require('../types/index.cjs');
25
25
  const getContentNodeByKeyPath = (dictionaryContent, keyPath) => {
26
- let currentValue = structuredClone(dictionaryContent ?? {});
26
+ let currentValue = structuredClone(dictionaryContent);
27
27
  for (const keyObj of keyPath) {
28
28
  if (keyObj.type === import_types.NodeType.Object || keyObj.type === import_types.NodeType.Array) {
29
29
  currentValue = currentValue?.[keyObj.key];
@@ -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,qBAAqB,CAAC,CAAC;AAE/D,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,aAAa,sBAAS,SAAS;AAAA,IAChD,WAAW,OAAO,SAAS,sBAAS,UAAU;AAC5C,qBAAe,aAAa,sBAAS,QAAQ;AAAA,IAC/C;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
@@ -0,0 +1,68 @@
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, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var getEmptyNode_exports = {};
20
+ __export(getEmptyNode_exports, {
21
+ getEmptyNode: () => getEmptyNode
22
+ });
23
+ module.exports = __toCommonJS(getEmptyNode_exports);
24
+ var import_types = require('../types/index.cjs');
25
+ const getEmptyNode = (section) => {
26
+ if (typeof section === "string") {
27
+ return "";
28
+ }
29
+ if (typeof section === "number") {
30
+ return 0;
31
+ }
32
+ if (typeof section === "boolean") {
33
+ return true;
34
+ }
35
+ if (typeof section?.nodeType === "string") {
36
+ const typedNode = section;
37
+ const content = typedNode[typedNode.nodeType];
38
+ if (typedNode.nodeType === import_types.NodeType.Translation || typedNode.nodeType === import_types.NodeType.Enumeration || typedNode.nodeType === import_types.NodeType.Condition) {
39
+ return getEmptyNode(content);
40
+ }
41
+ if (typedNode.nodeType === import_types.NodeType.Nested) {
42
+ return typedNode;
43
+ }
44
+ if (typedNode.nodeType === import_types.NodeType.Markdown) {
45
+ return getEmptyNode(typedNode);
46
+ }
47
+ return content;
48
+ }
49
+ if (!section || typeof section !== "object") {
50
+ return section;
51
+ }
52
+ if (Array.isArray(section)) {
53
+ return section.map(
54
+ getEmptyNode
55
+ );
56
+ }
57
+ const mappedSectionObject = Object.entries(section).map(([key, value]) => [
58
+ key,
59
+ getEmptyNode(value)
60
+ ]);
61
+ const mappedSectionArray = Object.fromEntries(mappedSectionObject);
62
+ return mappedSectionArray;
63
+ };
64
+ // Annotate the CommonJS export names for ESM import in node:
65
+ 0 && (module.exports = {
66
+ getEmptyNode
67
+ });
68
+ //# sourceMappingURL=getEmptyNode.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/dictionaryManipulator/getEmptyNode.ts"],"sourcesContent":["import { type ContentNode, type TypedNode, NodeType } from '../types';\n\nexport const getEmptyNode = (section: ContentNode): ContentNode => {\n if (typeof section === 'string') {\n return '';\n }\n if (typeof section === 'number') {\n return 0;\n }\n if (typeof section === 'boolean') {\n return true;\n }\n if (typeof (section as TypedNode)?.nodeType === 'string') {\n const typedNode = section as TypedNode;\n const content = typedNode[typedNode.nodeType as keyof TypedNode];\n\n if (\n typedNode.nodeType === NodeType.Translation ||\n typedNode.nodeType === NodeType.Enumeration ||\n typedNode.nodeType === NodeType.Condition\n ) {\n return getEmptyNode(content as ContentNode);\n }\n\n if (typedNode.nodeType === NodeType.Nested) {\n return typedNode;\n }\n\n if (typedNode.nodeType === NodeType.Markdown) {\n return getEmptyNode(typedNode);\n }\n\n return content;\n }\n\n if (!section || typeof section !== 'object') {\n return section;\n }\n\n if (Array.isArray(section)) {\n return (section as ContentNode[]).map(\n getEmptyNode\n ) as unknown as ContentNode;\n }\n\n const mappedSectionObject = Object.entries(section).map(([key, value]) => [\n key,\n getEmptyNode(value),\n ]);\n\n const mappedSectionArray = Object.fromEntries(mappedSectionObject);\n\n return mappedSectionArray;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2D;AAEpD,MAAM,eAAe,CAAC,YAAsC;AACjE,MAAI,OAAO,YAAY,UAAU;AAC/B,WAAO;AAAA,EACT;AACA,MAAI,OAAO,YAAY,UAAU;AAC/B,WAAO;AAAA,EACT;AACA,MAAI,OAAO,YAAY,WAAW;AAChC,WAAO;AAAA,EACT;AACA,MAAI,OAAQ,SAAuB,aAAa,UAAU;AACxD,UAAM,YAAY;AAClB,UAAM,UAAU,UAAU,UAAU,QAA2B;AAE/D,QACE,UAAU,aAAa,sBAAS,eAChC,UAAU,aAAa,sBAAS,eAChC,UAAU,aAAa,sBAAS,WAChC;AACA,aAAO,aAAa,OAAsB;AAAA,IAC5C;AAEA,QAAI,UAAU,aAAa,sBAAS,QAAQ;AAC1C,aAAO;AAAA,IACT;AAEA,QAAI,UAAU,aAAa,sBAAS,UAAU;AAC5C,aAAO,aAAa,SAAS;AAAA,IAC/B;AAEA,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,WAAW,OAAO,YAAY,UAAU;AAC3C,WAAO;AAAA,EACT;AAEA,MAAI,MAAM,QAAQ,OAAO,GAAG;AAC1B,WAAQ,QAA0B;AAAA,MAChC;AAAA,IACF;AAAA,EACF;AAEA,QAAM,sBAAsB,OAAO,QAAQ,OAAO,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AAAA,IACxE;AAAA,IACA,aAAa,KAAK;AAAA,EACpB,CAAC;AAED,QAAM,qBAAqB,OAAO,YAAY,mBAAmB;AAEjE,SAAO;AACT;","names":[]}
@@ -23,6 +23,7 @@ __reExport(dictionaryManipulator_exports, require('./renameContentNodeByKeyPath.
23
23
  __reExport(dictionaryManipulator_exports, require('./getNodeType.cjs'), module.exports);
24
24
  __reExport(dictionaryManipulator_exports, require('./updateNodeChildren.cjs'), module.exports);
25
25
  __reExport(dictionaryManipulator_exports, require('./getDefaultNode.cjs'), module.exports);
26
+ __reExport(dictionaryManipulator_exports, require('./getEmptyNode.cjs'), module.exports);
26
27
  // Annotate the CommonJS export names for ESM import in node:
27
28
  0 && (module.exports = {
28
29
  ...require('./editDictionaryByKeyPath.cjs'),
@@ -32,6 +33,7 @@ __reExport(dictionaryManipulator_exports, require('./getDefaultNode.cjs'), modul
32
33
  ...require('./renameContentNodeByKeyPath.cjs'),
33
34
  ...require('./getNodeType.cjs'),
34
35
  ...require('./updateNodeChildren.cjs'),
35
- ...require('./getDefaultNode.cjs')
36
+ ...require('./getDefaultNode.cjs'),
37
+ ...require('./getEmptyNode.cjs')
36
38
  });
37
39
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/dictionaryManipulator/index.ts"],"sourcesContent":["export * from './editDictionaryByKeyPath';\nexport * from './getContentNodeByKeyPath';\nexport * from './getNodeChildren';\nexport * from './removeContentNodeByKeyPath';\nexport * from './renameContentNodeByKeyPath';\nexport * from './getNodeType';\nexport * from './updateNodeChildren';\nexport * from './getDefaultNode';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0CAAc,sCAAd;AACA,0CAAc,sCADd;AAEA,0CAAc,8BAFd;AAGA,0CAAc,yCAHd;AAIA,0CAAc,yCAJd;AAKA,0CAAc,0BALd;AAMA,0CAAc,iCANd;AAOA,0CAAc,6BAPd;","names":[]}
1
+ {"version":3,"sources":["../../../src/dictionaryManipulator/index.ts"],"sourcesContent":["export * from './editDictionaryByKeyPath';\nexport * from './getContentNodeByKeyPath';\nexport * from './getNodeChildren';\nexport * from './removeContentNodeByKeyPath';\nexport * from './renameContentNodeByKeyPath';\nexport * from './getNodeType';\nexport * from './updateNodeChildren';\nexport * from './getDefaultNode';\nexport * from './getEmptyNode';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0CAAc,sCAAd;AACA,0CAAc,sCADd;AAEA,0CAAc,8BAFd;AAGA,0CAAc,yCAHd;AAIA,0CAAc,yCAJd;AAKA,0CAAc,0BALd;AAMA,0CAAc,iCANd;AAOA,0CAAc,6BAPd;AAQA,0CAAc,2BARd;","names":[]}
@@ -3,6 +3,9 @@ const editDictionaryByKeyPath = (dictionaryContent, keyPath, newValue) => {
3
3
  let currentValue = dictionaryContent;
4
4
  let parentValue = null;
5
5
  let lastKeys = [];
6
+ if (keyPath.length === 0) {
7
+ return newValue;
8
+ }
6
9
  for (let i = 0; i < keyPath.length; i++) {
7
10
  const keyObj = keyPath[i];
8
11
  parentValue = currentValue;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/dictionaryManipulator/editDictionaryByKeyPath.ts"],"sourcesContent":["import { type KeyPath, NodeType } from '../types';\nimport type { ContentNode } from '../types/dictionary';\n\ntype LastKeyType = string | number;\n\nexport const editDictionaryByKeyPath = (\n dictionaryContent: ContentNode,\n keyPath: KeyPath[],\n newValue: ContentNode\n): ContentNode => {\n let currentValue: any = dictionaryContent;\n let parentValue: any = null;\n let lastKeys: LastKeyType[] = [];\n\n for (let i = 0; i < keyPath.length; i++) {\n const keyObj = keyPath[i];\n parentValue = currentValue;\n\n if (keyObj.type === NodeType.Object) {\n lastKeys = [keyObj.key];\n if (\n !currentValue[keyObj.key] ||\n typeof currentValue[keyObj.key] !== 'object'\n ) {\n currentValue[keyObj.key] = {};\n }\n currentValue = currentValue[keyObj.key];\n } else if (keyObj.type === NodeType.Array) {\n lastKeys = [keyObj.key];\n if (\n !currentValue[keyObj.key] ||\n typeof currentValue[keyObj.key] !== 'object'\n ) {\n currentValue[keyObj.key] = {};\n }\n currentValue = currentValue[keyObj.key];\n } else if (keyObj.type === NodeType.Translation) {\n lastKeys = [NodeType.Translation, keyObj.key];\n if (\n !currentValue[NodeType.Translation] ||\n typeof currentValue[NodeType.Translation] !== 'object'\n ) {\n currentValue[NodeType.Translation] = {};\n }\n if (\n !currentValue[NodeType.Translation][keyObj.key] ||\n typeof currentValue[NodeType.Translation][keyObj.key] !== 'object'\n ) {\n currentValue[NodeType.Translation][keyObj.key] = {};\n }\n currentValue = currentValue[NodeType.Translation][keyObj.key];\n } else if (keyObj.type === NodeType.Enumeration) {\n lastKeys = [NodeType.Enumeration, keyObj.key];\n if (\n !currentValue[NodeType.Enumeration] ||\n typeof currentValue[NodeType.Enumeration] !== 'object'\n ) {\n currentValue[NodeType.Enumeration] = {};\n }\n if (\n !currentValue[NodeType.Enumeration][keyObj.key] ||\n typeof currentValue[NodeType.Enumeration][keyObj.key] !== 'object'\n ) {\n currentValue[NodeType.Enumeration][keyObj.key] = {};\n }\n currentValue = currentValue[NodeType.Enumeration][keyObj.key];\n } else if (keyObj.type === NodeType.Condition) {\n lastKeys = [NodeType.Condition, keyObj.key];\n if (\n !currentValue[NodeType.Condition] ||\n typeof currentValue[NodeType.Condition] !== 'object'\n ) {\n currentValue[NodeType.Condition] = {};\n }\n if (\n !currentValue[NodeType.Condition][keyObj.key] ||\n typeof currentValue[NodeType.Condition][keyObj.key] !== 'object'\n ) {\n currentValue[NodeType.Condition][keyObj.key] = {};\n }\n currentValue = currentValue[NodeType.Condition][keyObj.key];\n } else if (keyObj.type === NodeType.Markdown) {\n lastKeys = [NodeType.Markdown];\n if (\n !currentValue[NodeType.Markdown] ||\n typeof currentValue[NodeType.Markdown] !== 'object'\n ) {\n currentValue[NodeType.Markdown] = '';\n }\n currentValue = currentValue[NodeType.Markdown];\n } else if (keyObj.type === NodeType.Nested) {\n lastKeys = [NodeType.Nested];\n if (\n !currentValue[NodeType.Nested] ||\n typeof currentValue[NodeType.Nested] !== 'object'\n ) {\n currentValue[NodeType.Nested] = {};\n }\n currentValue = currentValue[NodeType.Nested];\n }\n\n // Only update the value when processing the last key in the keyPath.\n if (i === keyPath.length - 1 && parentValue && lastKeys.length > 0) {\n let target = parentValue;\n // Drill down if lastKeys contains more than one key.\n for (const key of lastKeys.slice(0, -1)) {\n target = target[key];\n }\n if (typeof newValue === 'undefined') {\n delete target[lastKeys[lastKeys.length - 1]];\n } else {\n target[lastKeys[lastKeys.length - 1]] = newValue;\n }\n }\n }\n return dictionaryContent;\n};\n"],"mappings":"AAAA,SAAuB,gBAAgB;AAKhC,MAAM,0BAA0B,CACrC,mBACA,SACA,aACgB;AAChB,MAAI,eAAoB;AACxB,MAAI,cAAmB;AACvB,MAAI,WAA0B,CAAC;AAE/B,WAAS,IAA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AAE,GAAG;AACvC,iBAAS,OAAO,GAAG;AAAA,MACrB;AACA,UAAI,OAAO,aAAa,aAAa;AACnC,eAAO,OAAO,SAAS,SAAS,SAAS,CAAC,CAAC;AAAA,MAC7C,OAAO;AACL,eAAO,SAAS,SAAS,SAAS,CAAC,CAAC,IAAI;AAAA,MAC1C;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../src/dictionaryManipulator/editDictionaryByKeyPath.ts"],"sourcesContent":["import { type KeyPath, NodeType } from '../types';\nimport type { ContentNode } from '../types/dictionary';\n\ntype LastKeyType = string | number;\n\nexport const editDictionaryByKeyPath = (\n dictionaryContent: ContentNode,\n keyPath: KeyPath[],\n newValue: ContentNode\n): ContentNode => {\n let currentValue: any = dictionaryContent;\n let parentValue: any = null;\n let lastKeys: LastKeyType[] = [];\n\n if (keyPath.length === 0) {\n return newValue;\n }\n\n for (let i = 0; i < keyPath.length; i++) {\n const keyObj = keyPath[i];\n parentValue = currentValue;\n\n if (keyObj.type === NodeType.Object) {\n lastKeys = [keyObj.key];\n if (\n !currentValue[keyObj.key] ||\n typeof currentValue[keyObj.key] !== 'object'\n ) {\n currentValue[keyObj.key] = {};\n }\n currentValue = currentValue[keyObj.key];\n } else if (keyObj.type === NodeType.Array) {\n lastKeys = [keyObj.key];\n if (\n !currentValue[keyObj.key] ||\n typeof currentValue[keyObj.key] !== 'object'\n ) {\n currentValue[keyObj.key] = {};\n }\n currentValue = currentValue[keyObj.key];\n } else if (keyObj.type === NodeType.Translation) {\n lastKeys = [NodeType.Translation, keyObj.key];\n if (\n !currentValue[NodeType.Translation] ||\n typeof currentValue[NodeType.Translation] !== 'object'\n ) {\n currentValue[NodeType.Translation] = {};\n }\n if (\n !currentValue[NodeType.Translation][keyObj.key] ||\n typeof currentValue[NodeType.Translation][keyObj.key] !== 'object'\n ) {\n currentValue[NodeType.Translation][keyObj.key] = {};\n }\n currentValue = currentValue[NodeType.Translation][keyObj.key];\n } else if (keyObj.type === NodeType.Enumeration) {\n lastKeys = [NodeType.Enumeration, keyObj.key];\n if (\n !currentValue[NodeType.Enumeration] ||\n typeof currentValue[NodeType.Enumeration] !== 'object'\n ) {\n currentValue[NodeType.Enumeration] = {};\n }\n if (\n !currentValue[NodeType.Enumeration][keyObj.key] ||\n typeof currentValue[NodeType.Enumeration][keyObj.key] !== 'object'\n ) {\n currentValue[NodeType.Enumeration][keyObj.key] = {};\n }\n currentValue = currentValue[NodeType.Enumeration][keyObj.key];\n } else if (keyObj.type === NodeType.Condition) {\n lastKeys = [NodeType.Condition, keyObj.key];\n if (\n !currentValue[NodeType.Condition] ||\n typeof currentValue[NodeType.Condition] !== 'object'\n ) {\n currentValue[NodeType.Condition] = {};\n }\n if (\n !currentValue[NodeType.Condition][keyObj.key] ||\n typeof currentValue[NodeType.Condition][keyObj.key] !== 'object'\n ) {\n currentValue[NodeType.Condition][keyObj.key] = {};\n }\n currentValue = currentValue[NodeType.Condition][keyObj.key];\n } else if (keyObj.type === NodeType.Markdown) {\n lastKeys = [NodeType.Markdown];\n if (\n !currentValue[NodeType.Markdown] ||\n typeof currentValue[NodeType.Markdown] !== 'object'\n ) {\n currentValue[NodeType.Markdown] = '';\n }\n currentValue = currentValue[NodeType.Markdown];\n } else if (keyObj.type === NodeType.Nested) {\n lastKeys = [NodeType.Nested];\n if (\n !currentValue[NodeType.Nested] ||\n typeof currentValue[NodeType.Nested] !== 'object'\n ) {\n currentValue[NodeType.Nested] = {};\n }\n currentValue = currentValue[NodeType.Nested];\n }\n\n // Only update the value when processing the last key in the keyPath.\n if (i === keyPath.length - 1 && parentValue && lastKeys.length > 0) {\n let target = parentValue;\n // Drill down if lastKeys contains more than one key.\n for (const key of lastKeys.slice(0, -1)) {\n target = target[key];\n }\n if (typeof newValue === 'undefined') {\n delete target[lastKeys[lastKeys.length - 1]];\n } else {\n target[lastKeys[lastKeys.length - 1]] = newValue;\n }\n }\n }\n return dictionaryContent;\n};\n"],"mappings":"AAA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SAAS,MAAM,IAAI,CAAC;AAAA,MACnC;AACA,qBAAe,aAAa,SAAS,MAAM;AAAA,IAC7C;AAGA,QAAI,MAAM,QAAQ,SAAS,KAAK,eAAe,SAAS,SAAS,GAAG;AAClE,UAAI,SAAS;AAEb,iBAAW,OAAO,SAAS,MAAM,GAAG,EAAE,GAAG;AACvC,iBAAS,OAAO,GAAG;AAAA,MACrB;AACA,UAAI,OAAO,aAAa,aAAa;AACnC,eAAO,OAAO,SAAS,SAAS,SAAS,CAAC,CAAC;AAAA,MAC7C,OAAO;AACL,eAAO,SAAS,SAAS,SAAS,CAAC,CAAC,IAAI;AAAA,MAC1C;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import { NodeType } from "../types/index.mjs";
2
2
  const getContentNodeByKeyPath = (dictionaryContent, keyPath) => {
3
- let currentValue = structuredClone(dictionaryContent ?? {});
3
+ let currentValue = structuredClone(dictionaryContent);
4
4
  for (const keyObj of keyPath) {
5
5
  if (keyObj.type === NodeType.Object || keyObj.type === NodeType.Array) {
6
6
  currentValue = currentValue?.[keyObj.key];
@@ -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,qBAAqB,CAAC,CAAC;AAE/D,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,aAAa,SAAS,SAAS;AAAA,IAChD,WAAW,OAAO,SAAS,SAAS,UAAU;AAC5C,qBAAe,aAAa,SAAS,QAAQ;AAAA,IAC/C;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
@@ -0,0 +1,44 @@
1
+ import { NodeType } from "../types/index.mjs";
2
+ const getEmptyNode = (section) => {
3
+ if (typeof section === "string") {
4
+ return "";
5
+ }
6
+ if (typeof section === "number") {
7
+ return 0;
8
+ }
9
+ if (typeof section === "boolean") {
10
+ return true;
11
+ }
12
+ if (typeof section?.nodeType === "string") {
13
+ const typedNode = section;
14
+ const content = typedNode[typedNode.nodeType];
15
+ if (typedNode.nodeType === NodeType.Translation || typedNode.nodeType === NodeType.Enumeration || typedNode.nodeType === NodeType.Condition) {
16
+ return getEmptyNode(content);
17
+ }
18
+ if (typedNode.nodeType === NodeType.Nested) {
19
+ return typedNode;
20
+ }
21
+ if (typedNode.nodeType === NodeType.Markdown) {
22
+ return getEmptyNode(typedNode);
23
+ }
24
+ return content;
25
+ }
26
+ if (!section || typeof section !== "object") {
27
+ return section;
28
+ }
29
+ if (Array.isArray(section)) {
30
+ return section.map(
31
+ getEmptyNode
32
+ );
33
+ }
34
+ const mappedSectionObject = Object.entries(section).map(([key, value]) => [
35
+ key,
36
+ getEmptyNode(value)
37
+ ]);
38
+ const mappedSectionArray = Object.fromEntries(mappedSectionObject);
39
+ return mappedSectionArray;
40
+ };
41
+ export {
42
+ getEmptyNode
43
+ };
44
+ //# sourceMappingURL=getEmptyNode.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/dictionaryManipulator/getEmptyNode.ts"],"sourcesContent":["import { type ContentNode, type TypedNode, NodeType } from '../types';\n\nexport const getEmptyNode = (section: ContentNode): ContentNode => {\n if (typeof section === 'string') {\n return '';\n }\n if (typeof section === 'number') {\n return 0;\n }\n if (typeof section === 'boolean') {\n return true;\n }\n if (typeof (section as TypedNode)?.nodeType === 'string') {\n const typedNode = section as TypedNode;\n const content = typedNode[typedNode.nodeType as keyof TypedNode];\n\n if (\n typedNode.nodeType === NodeType.Translation ||\n typedNode.nodeType === NodeType.Enumeration ||\n typedNode.nodeType === NodeType.Condition\n ) {\n return getEmptyNode(content as ContentNode);\n }\n\n if (typedNode.nodeType === NodeType.Nested) {\n return typedNode;\n }\n\n if (typedNode.nodeType === NodeType.Markdown) {\n return getEmptyNode(typedNode);\n }\n\n return content;\n }\n\n if (!section || typeof section !== 'object') {\n return section;\n }\n\n if (Array.isArray(section)) {\n return (section as ContentNode[]).map(\n getEmptyNode\n ) as unknown as ContentNode;\n }\n\n const mappedSectionObject = Object.entries(section).map(([key, value]) => [\n key,\n getEmptyNode(value),\n ]);\n\n const mappedSectionArray = Object.fromEntries(mappedSectionObject);\n\n return mappedSectionArray;\n};\n"],"mappings":"AAAA,SAA2C,gBAAgB;AAEpD,MAAM,eAAe,CAAC,YAAsC;AACjE,MAAI,OAAO,YAAY,UAAU;AAC/B,WAAO;AAAA,EACT;AACA,MAAI,OAAO,YAAY,UAAU;AAC/B,WAAO;AAAA,EACT;AACA,MAAI,OAAO,YAAY,WAAW;AAChC,WAAO;AAAA,EACT;AACA,MAAI,OAAQ,SAAuB,aAAa,UAAU;AACxD,UAAM,YAAY;AAClB,UAAM,UAAU,UAAU,UAAU,QAA2B;AAE/D,QACE,UAAU,aAAa,SAAS,eAChC,UAAU,aAAa,SAAS,eAChC,UAAU,aAAa,SAAS,WAChC;AACA,aAAO,aAAa,OAAsB;AAAA,IAC5C;AAEA,QAAI,UAAU,aAAa,SAAS,QAAQ;AAC1C,aAAO;AAAA,IACT;AAEA,QAAI,UAAU,aAAa,SAAS,UAAU;AAC5C,aAAO,aAAa,SAAS;AAAA,IAC/B;AAEA,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,WAAW,OAAO,YAAY,UAAU;AAC3C,WAAO;AAAA,EACT;AAEA,MAAI,MAAM,QAAQ,OAAO,GAAG;AAC1B,WAAQ,QAA0B;AAAA,MAChC;AAAA,IACF;AAAA,EACF;AAEA,QAAM,sBAAsB,OAAO,QAAQ,OAAO,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AAAA,IACxE;AAAA,IACA,aAAa,KAAK;AAAA,EACpB,CAAC;AAED,QAAM,qBAAqB,OAAO,YAAY,mBAAmB;AAEjE,SAAO;AACT;","names":[]}
@@ -6,4 +6,5 @@ export * from "./renameContentNodeByKeyPath.mjs";
6
6
  export * from "./getNodeType.mjs";
7
7
  export * from "./updateNodeChildren.mjs";
8
8
  export * from "./getDefaultNode.mjs";
9
+ export * from "./getEmptyNode.mjs";
9
10
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/dictionaryManipulator/index.ts"],"sourcesContent":["export * from './editDictionaryByKeyPath';\nexport * from './getContentNodeByKeyPath';\nexport * from './getNodeChildren';\nexport * from './removeContentNodeByKeyPath';\nexport * from './renameContentNodeByKeyPath';\nexport * from './getNodeType';\nexport * from './updateNodeChildren';\nexport * from './getDefaultNode';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../src/dictionaryManipulator/index.ts"],"sourcesContent":["export * from './editDictionaryByKeyPath';\nexport * from './getContentNodeByKeyPath';\nexport * from './getNodeChildren';\nexport * from './removeContentNodeByKeyPath';\nexport * from './renameContentNodeByKeyPath';\nexport * from './getNodeType';\nexport * from './updateNodeChildren';\nexport * from './getDefaultNode';\nexport * from './getEmptyNode';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"editDictionaryByKeyPath.d.ts","sourceRoot":"","sources":["../../../src/dictionaryManipulator/editDictionaryByKeyPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAY,MAAM,UAAU,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAIvD,eAAO,MAAM,uBAAuB,sBACf,WAAW,WACrB,OAAO,EAAE,YACR,WAAW,KACpB,WA2GF,CAAC"}
1
+ {"version":3,"file":"editDictionaryByKeyPath.d.ts","sourceRoot":"","sources":["../../../src/dictionaryManipulator/editDictionaryByKeyPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAY,MAAM,UAAU,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAIvD,eAAO,MAAM,uBAAuB,sBACf,WAAW,WACrB,OAAO,EAAE,YACR,WAAW,KACpB,WA+GF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type ContentNode } from '../types';
2
+ export declare const getEmptyNode: (section: ContentNode) => ContentNode;
3
+ //# sourceMappingURL=getEmptyNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getEmptyNode.d.ts","sourceRoot":"","sources":["../../../src/dictionaryManipulator/getEmptyNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAA4B,MAAM,UAAU,CAAC;AAEtE,eAAO,MAAM,YAAY,YAAa,WAAW,KAAG,WAmDnD,CAAC"}
@@ -6,4 +6,5 @@ export * from './renameContentNodeByKeyPath';
6
6
  export * from './getNodeType';
7
7
  export * from './updateNodeChildren';
8
8
  export * from './getDefaultNode';
9
+ export * from './getEmptyNode';
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dictionaryManipulator/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dictionaryManipulator/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/core",
3
- "version": "5.1.2",
3
+ "version": "5.1.4",
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/api": "5.1.2",
64
- "@intlayer/config": "5.1.2",
65
- "@intlayer/dictionaries-entry": "5.1.2"
63
+ "@intlayer/api": "5.1.4",
64
+ "@intlayer/config": "5.1.4",
65
+ "@intlayer/dictionaries-entry": "5.1.4"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@types/negotiator": "^0.6.3",
@@ -77,14 +77,14 @@
77
77
  "typescript": "^5.7.3",
78
78
  "@utils/eslint-config": "1.0.4",
79
79
  "@utils/ts-config": "1.0.4",
80
- "@utils/tsup-config": "1.0.4",
81
- "@utils/ts-config-types": "1.0.4"
80
+ "@utils/ts-config-types": "1.0.4",
81
+ "@utils/tsup-config": "1.0.4"
82
82
  },
83
83
  "peerDependencies": {
84
- "@intlayer/config": "5.1.2",
85
- "@intlayer/dictionaries-entry": "5.1.2",
86
- "@intlayer/api": "5.1.2",
87
- "intlayer": "5.1.2"
84
+ "@intlayer/api": "5.1.4",
85
+ "@intlayer/config": "5.1.4",
86
+ "intlayer": "5.1.4",
87
+ "@intlayer/dictionaries-entry": "5.1.4"
88
88
  },
89
89
  "engines": {
90
90
  "node": ">=14.18"